Hi,
I've been running Coppermine for a couple of weeks now and have a bunch of pictures uploaded that have already been put into galleries by Coppermine. Everything's been running fine but now when I try to upload pictures (whether through Batch Add or through the Upload interface) I get this error:
QuoteWarning: imagecreatefromjpeg: 'albums/userpics/10001/IMG_0939.jpg' is not a valid JPEG file in /homepages/1/d89097760/htdocs/cpg/include/picmgmt.inc.php on line 154
The image you have uploaded is corrupted or can't be handled by the GD library
I haven't changed anything with Coppermine's setup!
My server is running GD 1.x. I have tried multiple images and directories.
Can anyone help?
maybe your webhost has changed server config - try GD2 for a change.
Also make sure that the jpg in question is valid (there have been reports in the past about JPEGs in CMYK instead of RGB) - try opening it in another application, and save it as new file.
GauGau
I actually have this problem as well. In my case I am running Apache 2.0.48 and PHP 4.3.5RC4 on my server. When I look at the JPG files as they are uploaded, they get trunicated and I end up with an invalid JPG file.
So, the file I'm uploading is 191k. It ends up on the server at 105k. Then the GD program declares its not a complete JPG. Any clues?
Marcos
Are you uploading with your ftp in binary,or auto mode. if you are uploading in other modes this will cause corruption.
Well, I'm doing the single posting using the HTTP post option. Not doing the FTP version (that one should work fine since that is a protocol that does not use the PHP posting functions).
Looks like an Apache 2 issue :(
Try uploading via FTP and see if the same occurs... FTP method just might work
FTP with Binary is the safest way, please try and let us know.
Ok, I spent a lot of time getting FTP out of the environment. I'll build another one in a chroot'ed environment specifically for this application. Just for testing, I copied the files using SFTP (SFTP2) into an upload directory and then did the insertion using the batch add.
Using this method, no problems with the insertions into the pages. Using the exact same images using the "upload picture" option, continued to get errors on the upload of the file. My assumption is that once I get a chroot'ed ftp environment, that will work fine (security issue, but hey, this entire package is starting to look like a security issue)...
So... Looks like there is an interaction problem with the HTTP post between apache, php, and the upload/directory code that php has. I have no idea how to submit this problem to the PHP team and am suprised no one else has run across this problem.
---
On a side note, here are the compilation options used for both apache 2.0.48 and php 4.3.5RC4:
APACHE:
./configure --enable-info --enable-cgi --enable-so --enable-include --enable-rewrite --enable-ssl --with-ssl=/usr/local/ssl
PHP:
./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-png-dir=/usr/local --with-gd=/usr/local --with-zlib=/usr/local --with-gettext=/usr/local --with-jpeg-dir=/usr/local
You might build a simple PHP upload form to test this behavior further. There are a number of factors that could be at issue, i.e., timeouts, upload/post/memory settings in php.ini, and php request body limits in Apache. You might check the bug report board at www.php.net for some similar problem with this PHP version. Also, you might see what happens if you downgrade/upgrade from this version of PHP.
Since Apache 2 is not a recommended eviron for PHP in production sites it is strongly suggested that you not use it... and save yourself a lot of headache
I am saying this because I have been there and done that for a large setup (not only CPG but several other applications) and now we are downgrading to Apache 1.3
and me i have got the same problem but with the version 1.1. it works fine, now i wanted to install 1.3. or at least 1.2. but there is always the same error....need help...
this discussion about version numbers refered to apache webserver (version 1.3 vs version 2), not to coppermine versions.
GauGau