When I upload a JPG image up to roughly 1,500 x 2,000 pixels, Node Images works as expected. When I try to upload a JPG image of 2,400 x 2,400 pixels and 669 KB, I get an error dialog from Internet Explorer, "Unspecified error", apparently after the upload has completed. I can see the file in the temporary files folder on the server.
In Firefox the same happens, but I have the impression that it happens even before the file is completely uploaded.
I'm not sure whether the number of pixels plays any direct roleit could be the file size.
When I click on the OK button in the error dialog box, the "Uploading file" and moving bars display disappears, the "Upload" button is still there, but the "Image file:" input field and the "Search..." button do not reappear.
I have tested to upload the same files as attachments, i.e. without using Node Images, and that works, indicating that this is not a general problem with the upload function. One could speculate that it could still be some kind of timing problem in the upload module that is brought up by Node Images.
I just changed servers and went from PHP and MySQL versions 4.x to the versions shown above. The defect has always been there, but it is getting more troublesome now with more and more digital cameras producing larger and larger images.
I'd be very curious to know whether anybody else experiences this as well.
Configuration:
Drupal: 5.7
Database schema: Up to date
File system: Writable (public download method)
GD library: bundled (2.0.28 compatible)
MySQL database: 5.0.18
PHP: 5.1.2
PHP register globals: Disabled
Unicode library: PHP Mbstring Extension
Web server: Apache/2.2.0 (Linux/SUSE)
Internet Explorer and Firefox: current versions
Comments
Comment #1
hgmichna commentedFound the cause and solved the problem. The cause was that the image rescaling function in the graphics library that PHP uses (in my case gd.so) ran out of memory due to a far too small memory_limit setting in php.ini.
In php.ini I changed
memory_limit = 32M
to
memory_limit = 256M
That solved the problem. Tests revealed that a setting of 128M was still insufficient for a 25 Megapixel JPG image, so I doubled it and retested successfully.
My server has only 1 GB RAM, but I reckon that the 256 MB are rarely needed, and when they are needed, they are needed only for a few seconds. If the server runs short of memory during such image rescaling, it will become slow due to swapping, but that's still much better than an "unspecified error" dialog box.