AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
October 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2006.10.14 12:59 "SamplesPerPixel is 0 when loading image", by Marcel Wiesweg
2006.10.14 13:29 "Re: SamplesPerPixel is 0 when loading image", by Anurag Singh
2006.10.14 13:46 "Re: SamplesPerPixel is 0 when loading image", by Toby Thain
2006.10.14 14:53 "Re: SamplesPerPixel is 0 when loading image", by Anurag Singh
2006.10.14 21:22 "Re: SamplesPerPixel is 0 when loading image", by Toby Thain
2006.10.14 17:52 "Re: SamplesPerPixel is 0 when loading image", by Joris Van Damme
2006.10.15 15:18 "Re: SamplesPerPixel is 0 when loading image", by Gilles Caulier
2006.10.17 01:48 "Re: SamplesPerPixel is 0 when loading image", by Joris Van Damme
2006.10.14 22:36 "Re: SamplesPerPixel is 0 when loading image", by Joris Van Damme
2006.10.14 22:42 "Re: SamplesPerPixel is 0 when loading image", by Toby Thain
2006.10.14 22:56 "Re: SamplesPerPixel is 0 when loading image", by Joris Van Damme

2006.10.14 17:52 "Re: SamplesPerPixel is 0 when loading image", by Joris Van Damme

Marcel,

Thank you for the error report.

Marcel Wiesweg wrote:
> for the application digiKam (www.digikam.org) we are using libtiff in
> our image loader. A while ago we received a bug report from a user
> that opening certain 16-bit TIFF images failed. The report was later
> on confirmed by another user.
> Strangely, on other systems (on most systems, including mine) the
> test image loads without any problems.

As we all know, that is the hardest type of problem to debug. It's not
even guaranteed that the problem is in LibTiff, it may be totally
unrelated, as in a double free or out of bound memory access or race
condition anywhere in unrelated code in the same process.

Do you have any idea what might be the difference between the machines
where it worked, and the ones where it didn't? Did you spot any pattern?

> We investigated that the problem is that after calling
>     TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL,
> &samples_per_pixel); the value of samples_per_pixel is "0" on the
> affected machines, "3" on all others. This has been tested with
> different versions of libtiff.
>
> The full story can be found here:
> http://bugs.kde.org/show_bug.cgi?id=125916
>
> The test image is
> http://amigos.amiga.hu/dudeeg/digikam_tiff/IMG_4224-01.tif
>
> The source of out TIFF loader can be found at
>
http://websvn.kde.org/trunk/extragear/graphics/digikam/libs/dimg/loaders/tiffloader.cpp?view=auto
>
> Have you any idea what to do about this?

The image seems perfectly fine to me. So does the loader code, more or
less. (Though I have some unrelated remarks, like a fourth channel in
RGB images isn't always an alpha channel, nor the other way around,
you'd have to check the ExtraSamples tag. Also, from the looks of it, I
think you'll get into trouble with a 16 bits per channel RGB images with
multiple extra samples.)

What version of LibTiff did you test? Have different versions been
tested on the machines that gave a samples_per_pixel value of 0 in
particular?

How urgent is your problem?


Best regards,

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html