DooPHP IRC channel


DooGdImage uploading photo

This is for general DooPHP discussion. Ask your questions here.

Re: DooGdImage uploading photo

Postby smitshah » Thu Mar 11, 2010 7:02 am

i'm using DooGdImage lib but unable to upload .png file.other file like gif and jpg are uploaded successfully what should be the problem? :(
if i upload png file then this error occur

[code]Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in C:\wamp\www\app\dooframework\helper\DooGdImage.php on line 145

Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in C:\wamp\www\app\dooframework\helper\DooGdImage.php on line 145

Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in C:\wamp\www\app\dooframework\helper\DooGdImage.php on line 145

Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in C:\wamp\www\app\dooframework\helper\DooGdImage.php on line 145
smit shah
php developer(india)
smitshah
 
Posts: 11
Joined: Mon Nov 09, 2009 2:17 pm
Location: india

Re: DooGdImage uploading photo

Postby cevarief » Thu Mar 11, 2010 8:38 am

Hi, i think the problem is coming from the imagepng function. Try check this http://www.electrictoolbox.com/php-fatal-libpng-error-zlib-error/
So you might try to set $generatedQuality variable after instantiating the helper to 9 or lower instead of 100 for png file, eventhough this is bad practice as no setter function for $generatedQuality in the class.

You may consider dividing $generatedQuality of 'png' by 10 as long as it can make < 10, in the line 145.

Code: Select all
case 'png':
                return imagepng($img, $file, ($this->generatedQuality / 10)-1);
                break;
cevarief
 
Posts: 34
Joined: Fri Sep 25, 2009 12:49 am
Location: West Java

Re: DooGdImage uploading photo

Postby smitshah » Thu Mar 11, 2010 11:14 am

HI,
Thx for reply after posting i had see imagepng function so what i had done..... ;)
just remove generatedQuality parameter and works fine.and your solution is perfect.
Thanks!! :)
smit shah
php developer(india)
smitshah
 
Posts: 11
Joined: Mon Nov 09, 2009 2:17 pm
Location: india

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron