in reply to Corrupted data problem in copyResampled using GD.pm

What seems to be happening is that 1/4 to 1/2 of the image data is being dropped prior to finishing the thumbnail file.
Does that imply that the extent of corruption varies depending on the image? (Or simply that you're not sure what the real amount of lossage is?)

If it varies with the image, then maybe you should take a closer look at this line in your code:

if ($opsys eq "dos") { binmode THUMB; }
Are you sure that "$opsys" has been set appropriately? (Why aren't you just using "$^O" ?)

Apart from that, I don't know about the GD::Image "jpeg" method... what does it mean to pass it a value of "75"?

Replies are listed 'Best First'.
Re: Re: Corrupted data problem in copyResampled using GD.pm
by BUU (Prior) on Feb 10, 2004 at 07:33 UTC
    Better yet, just binmode THUMB; anyways, don't bother with the check. It only affects those operating systems it matters on.
      I know that $opsys is setting correctly. I use it instead of $^O because it sets some other variables in the script as well as this.

      The amount of corruption does vary from image to image and from browser to browser. I'm not sure what the reason is behind it. I wrote this script for a church and it's photos vary in corruption. You can see the images at http://mtziontrenton.com/cgi-bin/ezwebalbum.cgi With some images it was fine, with others it is a few lines, and others had major corruption.

      If you have any idea about why this is happening, please let me know!
        Have you tried just always calling binmode on whatever file handle you're using to output the image?