Error when uploading a new picture? Error when uploading a new picture?
 

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

Error when uploading a new picture?

Started by qwaven, April 25, 2004, 01:32:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

qwaven

Hello, I am having trouble getting pictures uploaded, with the regular upload picture option.

when I upload a picture, type in the filename/details/search options and click submit it gives me the following error:

"The picture 'albums/userpics/10001/image.jpg' can't be inserted in the album

Error executing ImageMagick - Return value: 1"

Can anyone tell me what this errror means and/or what I need to do in order to fix this problem?
I am running on FreeBSD 5.1, apache 2.x, PHP4, sql4.

Please let me know what you think, thanks :)


hyperion

You need to activate debug mode to get the extended error message.
"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)

qwaven

ok i got dev mode on and it says:

The picture 'albums/userpics/10001/1way.jpg' can't be inserted in the album

Error executing ImageMagick - Return value: 1


Cmd line :
/usr/local/share/ImageMagick/ImageMagick-6.0.0/bin/convert -quality 80 -antialias -geometry 67x100 'albums/userpics/10001/1way.jpg' 'albums/userpics/10001/thumb_1way.jpg'



The convert program said:
/usr/libexec/ld-elf.so.1: Shared object "libc_r.so.4" not found



File: /usr/local/www/data-dist/coppermine_dir/db_input.php - Line: 289

Any idea?

Joachim Müller

Image Magick seems not to be installed properly imo.
Ask your webhost (when webhosted). Fix it yourself (if self-hosted).

GauGau

qwaven

I am the host, it has worked in the past before I had was trying to delete a gallery...

rborn

I get this same error, and a few others when trying to upload most pictures.  I haven't narrowed it down yet but here is what I do know:

PHP version 4.2.2, Red Hat Linux 9 (2.4.20-8), ImageMagick 5.4.7 and using ImageMagick for converting in the config.

I also get this error at times:

The size of picture you have uploaded is too large (maximum allowed is 2048 x 2048) !

File: /var/www/html/cpg/db_input.php - Line: 267

My upload limit in PHP is 2M, Post is 8M, the pictures are only about 700KB and 1280x960.  My CPG config is set for 1024 max upload size and 2048 pixels. Although I have changed this higher with the same results.

I also get a "The page cannot be displayed" error some times.

I can manually from the command line type the convert command and it works fine.  This assumes I add the pic to the userpics directory manually.

So it does not seem to be a ImageMagick problem on the surface since I can convert the picture.  Since the error always seems to stem from the db_input.php file and around the check of the image properties, could it be it's not getting the proper information?

I also get an error at times from line 275 which is the 2nd to last line of the following code:
} elseif ($imginfo == null) {
           @unlink($uploaded_pic);
           cpg_die(ERROR, $lang_db_input_php['err_invalid_img'], __FILE__, __LINE__, true);
           // JPEG and PNG only are allowed with GD

Is there a way to check the $imginfo?  Am I way off base here?

I can upload small jpg's, like clip art without problem, but not digital pictures taken from a digital camera.  Again, I can convert them manually from the command line.  Since the error I get changes from time to time and at times seems incorrect, as in I have exceeded the max. image size when it appears I didn't, I think something is getting lost somewhere.  But, since I can do small clip art without a problem...who knows.

I have some additional information, not as enlightening, but thought it would make the post too long.  I can post that should none of this is helpful.

Thanks,

Russell

Casper

This could be down to your Post limit.
Try changing it to 16m, or higher, and see if that helps.
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

hyperion

Also check your PHP_body_request_limit, which Redhat usually sets to a ridiculous 512KB.
"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)

rborn

Changed my post limit with no success.  I do get the same error on the same file no matter how many times I try to upload it or where the original file is located.  I have two pictures, one 1280 x 960 584 KB, the other is 960 x 1280 507 KB.  I got different errors when I tried to upload them from their original locations.  The error on the first file was that it was not a valid image file, the error on the second was similar to that as described in the original post but error number 198 not 1.  I moved the files to the root of my XP local drive, opened them in Photoshop, re-saved them as JPEG's (which they were originally) and tried to upload them again.  I figured I should get the same errors for both files, if I got any.  When I try to upload the first file, I get a "Page can not be found" error.  When I try to upload the second, I get this error:

The picture 'albums/userpics/10003/AUT_3381.jpg' can't be inserted in the album

Error executing ImageMagick - Return value: 198


Cmd line :
/usr/bin/convert -quality 80 -antialias -geometry 75x100 'albums/userpics/10003/AUT_3381.jpg' 'albums/userpics/10003/thumb_AUT_3381.jpg'



The convert program said:
convert: Invalid JPEG file structure: two SOF markers (albums/userpics/10003/AUT_3381.jpg).
convert: Missing an image file name.



File: /var/www/html/cpg/db_input.php - Line: 289


I am assuming it copies the picture file to /albums/userpics then makes the conversion (according to the command in the  error message, the copying operation and location is what I am assuming.  The file is not there however, but I'm not sure it should be.  I actually copied it there once manually but the command line shows that it renames the file it is converting by adding a "~0" to the end.

I did not try changing PHP_body_request_limit.  I can't find this anywhere and searched both the PHP website and Red Hat with no luck.  If you could point me in the right direction I would like to try changing that.

One more bit of information.  I am using this on an Intranet, not on the Internet.  I have a Linux server located on a Windows NT 4.0 network which serves files, web pages, internal email, a BB, and this album.

rborn

In looking at another post about having problems moving files, it reminded me of something.  Let me try something else before anyone wastes time responding.  I did not have a /tmp directory in the root of my web location, although I do now.  But it may still not be seeing it correctly.

rborn

...nevermind.  I have made a /tmp and /temp, chmod them to 777 but still no change.

hyperion

"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)

rborn

The body_request_limit was set low as you stated although it didn't help in raising it.  I finally upgraded to ImageMagick 6.0.1 and upgraded my libjpeg to the latest version.  Now most of the time the errors I got previously have gone away but now I am getting garbled pictures (meaning about half of the pic looks fine and the rest is a mess). It may make the top half ok then repeat the top on the bottom half but with a differnent color shade.  It does this to every picture, small or large.  It also gives me various errors on some pics that the picture is too large, when I am sure it isn't, or that's it's an invalid image.  As before, I can convert any of these manually on the command line.
The body_request_limit was set low as you stated although it didn't help in raising it.  I finally upgraded to ImageMagick 6.0.1 and upgraded my libjpeg to the latest version.  Now most of the time the errors I got previously have gone away but now I am getting garbled pictures (meaning about half of the pic looks fine than the rest is a mess). It may make the top half ok the repeat the top on the bottom half.  Now it does this to every picture, small or large.  It also gives me an error that the picture is too large, when I am sure it isn't, or that's it's an invalid image.  

If I add the pictures using the Batch Add option, it works fine, for any of the pictures I get errors for above, although for some reason it tries to add two of each.  This may be unrelated, but the program also adds two Albums of teh same name when I enter one.  I assumed I was doing something wrong and it didn't bother me too much as I just delete one of them.
If I add the pictures using the Batch Add option, it works fine, for any of the pictures I get errors for above, although for some reason it tries to add two of each.  This may be unrelated, but the program also adds two Albums of the same name when I enter one.  I assumed I was doing something wrong and it didn't bother me too much as I just delete one of them.

So, does this mean anything, that the batch will work and the upload won't?  I searched the forum and came up with several similar problems, but all were either not solved, or had problems with things I have pretty much ruled out or did not apply in my situation.  Oh, and I get the same problem using GD1 (don't have GD2 installed) as I do with ImageMagick (what I want to use).  I also saw a post where someone said that they would not recommend using Apache 2, which I am using.  If this is the case, I can try 1.3 but would like some word before going through the hassle of installing it.

Thanks

rborn

One thing to note, and I never suspected Coppermine itself, but when I upload images using a mod for my phpBB, I get the same problem, garbled images (using ImagMagick there also).  The first third to half is ok, then it goes random or grey in color.

I'm not sure what this points to.  I would suspect ImageMagick but it works fine when I do it manually.  So maybe Apache?

hyperion

Possibly, but I use A2 without difficulty.  You may be getting file corruption from somewhere. At this point, there is little we can do for you.  Try general troubleshooting (install new Apache, PHP, IM, monitor memory use when using IM, try GD2,  etc. ) If you find a solution, please post it here.
"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)

Joachim Müller

try adding less pics at a time...

GauGau