Reply to PNG upload ERROR

PNG upload ERROR new!
by Jared Mitchell, 16 years, 11 months ago
Came across this error while testing the upload class.

"I was having a terrible time with the imagecreatefrompng function as it was working perfectly for one image and not at all for another. After many hours of frustration, I discovered that the problem was the image size (number of pixels). It appears that the maximum number of pixels this function will process is 1,040,000. So, be sure that the pixel resolution of the image (eg. 1040 x 1000) does not exceed this value."

The above was taken from php.net.

This causes an issue on line 2884 of the class.upload.php

my fix was to replace the line with additional size checks
if ( (!function_exists('imagecreatefrompng')) || ($this->image_src_x > '950') || ($this->image_src_y > '750') ) 

While not perfect it does stop the problem of having the script exit without returning an error.

Regards,
JaredReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important