Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 17374
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: theslugger [...] mathlab.sunysb.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Reversed bit Image when saving in fax class
Input Tiff image is all white. Output tiff image is saved as black if fax class is used. This does not happen for any other image format. I have attached a sample image and code: use Imager; $file = 'blank.tif'; # Create an image object my $image = Imager->new; # read the image into memory $image->read(file=>$file) or die "Cannot load $file: ", $image->errstr; $image->write(file=>"out.tif", class=>'fax') or die "Cannot save out.tif: ", $image->errstr;
Subject: blank.tif
Download blank.tif
image/tiff 9.2k
blank.tif
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #17374] Reversed bit Image when saving in fax class
Date: Tue, 31 Jan 2006 11:06:12 +1100
To: Guest via RT <bug-Imager [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Mon, Jan 30, 2006 at 06:12:35PM -0500, Guest via RT wrote: Show quoted text
> Input Tiff image is all white. Output tiff image is saved as black if > fax class is used. This does not happen for any other image format. I > have attached a sample image and code:
Thanks for reporting this. When I look at the output image in the GIMP the output image shows as white, but if I look at it with Paint Shop Pro it shows as black. From looking at the TIFF spec it looks like GIMP (and Imager) are technically handling this correctly, but the current setup isn't all that natural for fax applications. I've modified Imager to use the more natural photometric interpretation for fax compressed images, and the output now shows as white in both GIMP and PSP. I've attached a patch you can apply locally and the resulting output from your script. Please let me know know whether your viewer shows the resulting output correctly, and if you get a chance, your experience with that attached patch. You will get a rejected chunk on the Changes file when applying the patch. Unless you reply that this didn't fix the problem this will be released with Imager 0.48. Thanks again Tony Cook --- I'm not sure the updated rt.cpan.org will pass the attachments through, they're also available at: http://imager.perl.org/files/tiff_fax_photometric.diff.txt http://imager.perl.org/files/faxout.tif

Message body is not shown because sender requested not to inline it.

Download out.tif
image/tiff 8.1k

Message body is not shown because sender requested not to inline it.

CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #17374] Reversed bit Image when saving in fax class
Date: Tue, 31 Jan 2006 11:23:20 +1100
To: Guest via RT <bug-Imager [...] rt.cpan.org>
From: Tony Cook <tony [...] develop-help.com>
On Mon, Jan 30, 2006 at 06:12:35PM -0500, Guest via RT wrote: Show quoted text
> Input Tiff image is all white. Output tiff image is saved as black if > fax class is used. This does not happen for any other image format. I > have attached a sample image and code:
Just to note: The patch will cause a single test failure in t/t106tiff.t due to the change in the photometric interpretation value. You can ignore this. Tony Cook
From: slugger [...] mathlab.sunysb.edu
Thanks for the patch. It works wonderfully! However, when I patched it and compiled, the compiler returned a failed on the make test. t/t106tiff........dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 21 Failed 1/89 tests, 98.88% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/t106tiff.t 1 256 89 1 1.12% 21 other than that, everything else is fine and works great. The output image is as expected. On Mon Jan 30 19:24:12 2006, tony@develop-help.com wrote: Show quoted text
> On Mon, Jan 30, 2006 at 06:12:35PM -0500, Guest via RT wrote:
> > Input Tiff image is all white. Output tiff image is saved as black if > > fax class is used. This does not happen for any other image format. I > > have attached a sample image and code:
> > Just to note: > > The patch will cause a single test failure in t/t106tiff.t due to the > change in the photometric interpretation value. You can ignore this. > > Tony Cook
On Mon Jan 30 18:12:34 2006, guest wrote: Show quoted text
> Input Tiff image is all white. Output tiff image is saved as black if > fax class is used. This does not happen for any other image format. I > have attached a sample image and code:
Hi, Imager 0.47_01, a pre-release of Imager 0.48, should now be available on your CPAN mirror, and should fix this issue. If you get a chance, please try testing this release. If you have the CPAN shell configured you can test this with: test T/TO/TONYC/Imager-0.47_01.tar.gz Thanks Tony Cook