Can't upload photos!! Can't upload photos!!
 

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

Can't upload photos!!

Started by jpepin, February 14, 2004, 12:52:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jpepin

ok, I'm trying ot upload photos into an album using the single photo methad (I'm testing everything out before I  fully implement the gallery on my site) and I keep getting this error:
-----------------------------
The picture 'albums/userpics/10001/blackeyeday.JPG' can't be inserted in the album

The image you have uploaded is corrupted or can't be handled by the GD library

File: /homepages/12/d90494846/htdocs/gallery/db_input.php - Line: 289


Warning: imagecreatefromjpeg: 'albums/userpics/10001/blackeyeday.JPG' is not a valid JPEG file in /homepages/12/d90494846/htdocs/gallery/include/picmgmt.inc.php on line 154
--------------------------

It doesn't happen all the time.  But I can't figure out what is keeping certain pictures from being uploaded.  

My server uses GD 1 and the file size for the example above is around 300kb.  

Any ideas?

Joachim Müller

Well, the error message says that the image you're trying to upload is corrupt. Did you check that? Maybe it's one of the rare JPEGS in CMYK format...
If the pic seems to be OK for you, upload it by ftp to your webspace and give us the full url of the pic (not the page embedding it) so we can have a look at the file.

GauGau

hyperion

Also, please state your PHP and GD versions, as some of the old ones have bugs that can cause this problem.

Nonstandard image editing software could be the source of the problem as well.
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

jpepin

Hi all, thanks for the wuick responses.  Here's the info you wanted:

link to pic: www.pepinonline.com/blackeyeday.jpg

php version = 4.2.3
GD version= "1.6.2 or higher"

photo was edited with adobe photoshop... here are the specs of the pic.  

(//www.pepinonline.com/specs.jpg)

after some experimenting. I think it may have something ot do with the size...but it's still under th max size set up in the gallery, so that shouldn't be a problem.  
thanks for the help

Casper

Hi,

The link to the pic above did not work for me, but I got there by typing the url manually.

The pic is very big, and sometimes this causes problems, although usually the error message is about exceeding the allowed memory.

Try uploading a smaller copy, say 800x600, and see if this works.

ps, I hope he's better now, poor lad.  Something to tell his friends about heh.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

jpepin

His eye's better now...decided to catch a softball with no hands!  The pic is 2 days later, too!! :D  

I did try smaller sizes, and it works fine.  But I'd rather not have to resize all my pictures before uploaing.  Isn't that picture size within the acceptable parameters?  Thanks for the help  :wink:

Casper

you can set whatever parameters you want in coppermine, but the problem usualy is with the server not allowing sufficient resourses for the image program to do its work, i.e., it sets the allowed memory usage too low.

This usually only affects pics with a large pixel size, regardless of the image quality, so an image of 1600x1200, compressed to low quality at say 1mb, may fail, but the same image, reduced to 1000x750, but saved at higher quality and at 1.5mb would be ok

Ps, and I took my son to the hospital when he was 2, with a similar injury(done playing footie in the garden), and was horrified when he went round the A&E(ER) saying 'my dad did this'.  Thought they would take him away and put me away.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

jpepin

Well that would explain it.  
I'll contact my server and see what they say.  thanks for the help!  :D

jpepin

update...I took the pic s that i had trouble with, opened them in Paint, and saved them...no modifications done....

and now they upload no problem!!!

I had used adobe photoshop originally.  Why would saving them with paint make them ok?

hyperion

Most likely, the image libraries for GD on your server have not been updated in a long time.  

Once in a while, there is an image type (i.e. Photoshop 5 interlaced JPEGs) GD has trouble with, and the proper adjustments are made in the next release.  Photoshop is the standard for image editing software, so this problem most likely does not occur in newer GD versions.

Your webmaster kept GD 1.6 to preserve GIF read/write support.  Ask him to install ImageMagick for you.  Alternatively, you can ask him to upgrade to the latest version of GD, which has included GIF read support (no write support yet).
"Then, Fletch," that bright creature said to him, and the voice was very kind, "let's begin with level flight . . . ."

-Richard Bach, Jonathan Livingston Seagull

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.mozilla.org%2Fproducts%2Ffirefox%2Fbuttons%2Fgetfirefox_small.png&hash=9f6d645801cbc882a52f0ee76cfeda02625fc537)

mdella

Ok, I have this exact same problem.  I've done quite a bit of testing and here are some of the resulting problems I've run into (I still don't know the answer, but...)

Background:

http://www.geekstyle.net/cpg
Apache 2.0.48
mod_perl 1.99_13
PHP 4.3.5rc4
openssl 0.9.7d
perl 5.8.0
mod_ssl 2.0.48

in php.ini:
same_mode=0ff
memory_limit = 16M

----

I have uploaded various different JPG files ranging in size from 50k to 500k with pretty consistant results.  In looking at the directory as they are being uploaded, for some reason, the entire file is not uploaded.  For example, if the original JPG file is 180k on my laptop, it only gets around 105k uploaded.  Of course since this is a trunicated file, GD complains that its not a valid JPG file and the system crashes.

I suspect that this is a PHP problem, but haven't been able to figure out where the problem actually resides or how to even really test it beyond what I've don't so far (any suggestions appreciated).

Anyway, its rather frustrating in that there is no way I can get pictures uploaded to the system to do much more with it :-/

ARGH!

Marcos
geek@geekstyle.net