occasional image quality problems

ohthetrees

Joined: 2002-09-18
Posts: 20
Posted: Thu, 2002-09-19 07:01

When I upload a whole folder of pics it works pretty well, but about 1 out of 30 to 40 pics will be corrupted. Usually the thumb, normal, and full sized version will all be corrupted in the same way. So far I have seen one with a red tinge, one that looked foggy white over two thirds of it, one that was blank on the bottom half, and one that was very dark on the bottom half. I imagine netpbm might be to blame, although I did use the binaries provided on this site.

mac os 10.2 php info: http://aliandcedar.com:400/info.php

thanks

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2002-09-21 07:54

If you re-upload the same image does it work?

Gallery doesn't touch the original file, so if the original is corrupted then that's the way that Gallery received it... that implies that what you're seeing is a file transfer corruption issue (which is rare, but it happens).

 
ohthetrees

Joined: 2002-09-18
Posts: 20
Posted: Sun, 2002-09-22 01:07

if I re-upload, the picture turns out fine. However, the way I upload is to dump pictures into a staging directory on my webserver, then import using the url of the folder. So really gallery is uploading from the same site that it is running on. Where is the opportunity for corruption? If I look at the original (in the staging directory) it looks fine. The corruption happens between when I ask gallery to upload from a particular directory, and when it is posted. I have not noted any corruption on any pics when I upload them to my web server by other means.

thanks for your help,

cedar

update: my copy of gallery seems to be doing more than just uploading the full sized version of the picture. It seems to be creating a version that is the same pixel dimensions as the original, but is jpeg optimized to a different (more compressed) level than the original. So I seem to be getting three sizes total, a thumb, a medium sized, and an original sized version that is compressed. Am I on crack, or is this really happening?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2002-09-23 07:23

When you upload from the same server, are you using a URL or a direct filesystem path? Gallery invokes different PHP commands for those two situations.

If it's a filesystem path, Gallery is using PHP's built-in copy() function to move the file. If it's a URL we do some slightly more complicated stuff. Either way, we're counting on PHP's system calls to get it right.

I'd suggest that you upgrade PHP from 4.1.2 to 4.2.3, since I know they made some improvements in this code in the 4.2.x line.

 
ohthetrees

Joined: 2002-09-18
Posts: 20
Posted: Tue, 2002-09-24 19:29

I upload both ways, and experience corruption both ways.

I'm looking into upgrading php. I'm not quite up to compiling it myself, but marc liyanage has binaries posted on his website. He notes this:

Quote:
NOTE regarding 4.2.3: I had to remove support for the --enable-mbstr-enc-trans option because that caused POST variables to be cut off in certain circumstances.
It seemed to be related to the use of multi-value input field names with the [] syntax. I'd appreciate some more reports about this, especially from other platforms.
If you experience this problem with my 4.2.3 module, please re-download the fixed version now or change your FORM tags in your HTML code to include this:
enctype="multipart/form-data"

do I care about this? Should I upgrade to 4.2.3 despite this complication?

An update to the corruption issue (it gets weirder).
Background: I have an album with 32 pics in it named pool 1-15 and farm 1-17. Of course there are thumbs, resized and full sized versions of each. You can look at this album yourself if you care to: http://www.aliandcedar.com/gallery/farm Reminder: I'm running OS X 10.2.

If I view my album using explorer pool1 and farm10 resized and farm16 full sized look corrupted
If I view my album using mozilla, pool2 resized and pool10 full size look corrupted.
Zero overlap!? This is reproducible. If I restart browsers, etc. I even navigated directly to my albums folder and looked at the pics directly in the browser, and still corrupted. If I look at the files using photoshop they all look fine. I compiled a more recent version of netpbm and things don't seem to have improved. I even installed the daily build of gallery on a different machine (configured identically) and experienced similar corruption problems. The only thing left is to replace php, then I throw up my hands.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2002-09-25 03:42
Quote:
If you experience this problem with my 4.2.3 module, please re-download the fixed version now or change your FORM tags in your HTML code to include this:
enctype="multipart/form-data"

Gallery 1.x does use this encoding type in the forms which upload image data, so
you should be ok.

Quote:
If I view my album using explorer pool1 and farm10 resized and farm16 full sized look corrupted If I view my album using mozilla, pool2 resized and pool10 full size look corrupted.

That's odd. I just checked out pool1 resized, farm10 resized, farm 16 full using IE 6.0 and they looked fine to me. Are you sure you're not seeing a corrupted version of the image from your browser cache?

 
ohthetrees

Joined: 2002-09-18
Posts: 20
Posted: Thu, 2002-09-26 20:50

you are right, it was a cached version. I was right clicking and hitting reload image, but that doesn't seem to have been enough. I cleared the cache and restarted the browser and things looked ok. However, the original corruption problem was real. I made three changes that could have fixed it. One, I started uploading using a file path, rather than a web address (easily testable.), two, I recompliled netpbm to a more recent version, and three, I updated my php module. Anyway, it all works now. Yipee!