coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: klittle on March 22, 2004, 04:56:53 PM

Title: Not valid JPEG file no matter what I do...
Post by: klittle on March 22, 2004, 04:56:53 PM
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?
Title: Not valid JPEG file no matter what I do...
Post by: Joachim Müller on March 22, 2004, 05:43:38 PM
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
Title: Problems with JPG uploads...
Post by: mdella on March 22, 2004, 07:47:44 PM
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
Title: Not valid JPEG file no matter what I do...
Post by: Casper on March 22, 2004, 09:45:07 PM
Are you uploading with your ftp in binary,or auto mode.  if you are uploading in other modes this will cause corruption.
Title: Uploading method...
Post by: mdella on March 23, 2004, 06:32:28 AM
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).
Title: Not valid JPEG file no matter what I do...
Post by: Tarique Sani on March 23, 2004, 06:38:49 AM
Looks like an Apache 2 issue :(

Try uploading via FTP and see if the same occurs... FTP method just might work
Title: Not valid JPEG file no matter what I do...
Post by: tatapx on March 23, 2004, 02:17:44 PM
FTP with Binary is the safest way, please try and let us know.
Title: uploading and the like...
Post by: mdella on March 23, 2004, 09:01:12 PM
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
Title: Not valid JPEG file no matter what I do...
Post by: hyperion on March 24, 2004, 12:42:51 AM
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.
Title: Not valid JPEG file no matter what I do...
Post by: Tarique Sani on March 24, 2004, 03:49:05 AM
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
Title: Re: Not valid JPEG file no matter what I do...
Post by: Indy0130 on May 05, 2004, 08:59:52 PM
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...
Title: Re: Not valid JPEG file no matter what I do...
Post by: Joachim Müller on May 06, 2004, 07:56:25 AM
this discussion about version numbers refered to apache webserver (version 1.3 vs version 2), not to coppermine versions.

GauGau