Warning: imagecreatefromjpeg(): - GD lib update problems ??? Warning: imagecreatefromjpeg(): - GD lib update problems ???
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Warning: imagecreatefromjpeg(): - GD lib update problems ???

Started by DerWolf, July 26, 2004, 04:59:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DerWolf

Dear fellow Coppermine users,

I got coppermine running on my system until 4.7 in the documentation. The thumnail creation process does not work. Whenever I try this Batch-Add Pictures - Process, I get the small red crosses instead, clicking on them I learn about the error:

<Warning: imagecreatefromjpeg(): 'albums/PhilosophieAmBerg/IMG_1547.JPG' is not a valid JPEG file in "..."/cpg1.3.1/include/picmgmt.inc.php on line 200
The image you have uploaded is corrupted or can't be handled by the GD library>

The jpg-file is though a normal true color jpe file from my canon s110. Also using XNview to change the file did not change the error.

According to my ISP they are running on PHP 4.3.6 and GD 2.0.21 (you can verify with http://derdaist.com/phpinfo.php). Some ISP-help person told me something about changed scripts in GD 2. Something like "imagecreatetruecolor..." instead of "imagecreatefromjpeg". He thought that the scripts I am running (coppermine) might be old and therefore do not use these new scripts which are necessary for Jpegs > 256 colors. Well, I do not think that yours scripts are old, but ..

what is the problem.

Thanks for any help!

Wolf



Joachim Müller

there are indeed differences in the way GD handles images - GD1 was only able to handle 256 colors, GD2 is capable of handling true color. That's why there is a great difference between GD1 and GD2, and that's why you can specify in coppermine config which version of GD you're using. However, if you have chosen GD2, the error you're experiencing is probably not related to GD. Instead, make sure your albums folder is CHMODed as suggested in the docs. Try uploading a known-good jpeg file (you could download a small file from our demo) with small file size and low resolution. Modern cameras produce pics with very high resolutions - depending on your server config you might not be able to upload pics coming from your camera without resizing on the client.
Also please take a look at the sticky topics on the uploads board (they have a pin icon).

GauGau

DerWolf

Thanks for your answer and the link to the upload topics, GauGau. On the one hand you helped me nail down the problem, on the other I still not up running my application.

It WAS actually the type of jpg I used. After down- and uploading some random photos from google to my albums, coppermine worked fine with all these pictures - but not for MINE. I do not know what it is:

1) Not size. Coppermine worked fine with some 519 kb from the net. Not with my 456 kb file from my Canon Digial IXUS II (= Canon S 110 in US).
2) The 256 color issue. Perhaps?
- But how could then all the other Coppermine users work around this problem. I mean, I cannot be the only one who wants to upload directly his pics from the camera or has a camera with true color pics as result. But I also converted
- I also used XNview to transform one of my pics to B&W. Did not help
3) Are there different formats of jpg. One of which cannot be handled by GD?

I put both of the pictures on derdaist.com/index.html
- The Color one: 500 kb from the web: friend of coppermine
- B&W: 223 kb from my camera: does not work with coppermine

I greatly appreciate your help  ::)
Wolfgang

DerWolf


Is it possible that GD cannot handle jpeg-files with 2048 x 1536 pixel  ;)  This is a difference of all the pics from me tried so far.

If yes, how could I get around - without changing the size of the wonderful pix before posting. I mean thumbnails should be nice and small. But the orginal files should have all their qualities. No?  ???

Thanks again,
Wolf

Joachim Müller

the filesize and resolution GD can handle is not generic, but there are restrictions that are caused by your server setup. Usually (if you're webhosted), you can't change any of those settings, only thing you could do is to ask you webhost to change them for you (but usually they don't, as they set up the restrictions for a good reason). Please read the sticky threads on this board (the ones with a pin icon), this is all explained in detail there.
There are indeed different formats of jpeg files, GD usually can't handle other jpegs than those in true color rbg (e.g. GD can't handle CMYK jpegs). There have been others who have reported they're not able to directly upload files from their camera, you really should consider resizing them on your client. A good (and free) tool to batch-resize is IrfanView.

GauGau

DerWolf

It was just the filesize

2048 x 1536 would not work
1600 x 1200 does work

Thanks!
Wolf