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
May 2010

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

2010.05.11 15:32 "Tiff with varying bit depths", by Thomas Richter
2010.05.11 15:49 "Re: Tiff with varying bit depths", by Frank Warmerdam
2010.05.11 16:02 "Re: Tiff with varying bit depths", by Thomas Richter
2010.05.11 16:31 "Re: Tiff with varying bit depths", by Scott Ribe
2010.05.11 16:52 "Re: Tiff with varying bit depths", by Igor Skochinsky
2010.05.11 16:58 "Re: Tiff with varying bit depths", by Scott Ribe
2010.05.11 19:19 "Re: Tiff with varying bit depths", by Thomas Richter
2010.05.11 15:58 "Re: Tiff with varying bit depths", by Bob Friesenhahn
2010.05.11 20:16 "Re: Tiff with varying bit depths", by Joris Van Damme
2010.05.11 20:22 "Re: Tiff with varying bit depths", by Thomas Richter
2010.05.11 21:33 "Re: Tiff with varying bit depths", by Joris Van Damme

2010.05.11 16:02 "Re: Tiff with varying bit depths", by Thomas Richter

Frank Warmerdam schrieb:
> Thomas Richter wrote:
>> Hi folks,
>>
>> I currently have a need to read and write TIFF files with a varying 
>> bit depth. To be specific, this is a BGR565 image packed into TIFF:
>>
>> $ tiffdump out.tif
>> out.tif:
>> Magic: 0x4949 <little-endian> Version: 0x2a
>> Directory 0: offset 8 (0x8) next 0 (0)
>> ImageWidth (256) LONG (4) 1<64>
>> ImageLength (257) LONG (4) 1<64>
>> BitsPerSample (258) SHORT (3) 3<5 6 5>
>> Compression (259) SHORT (3) 1<1>
>> Photometric (262) SHORT (3) 1<2>
>> StripOffsets (273) LONG (4) 1<140>
>> SamplesPerPixel (277) SHORT (3) 1<3>
>> RowsPerStrip (278) LONG (4) 1<64>
>> StripByteCounts (279) LONG (4) 1<8192>
>> SampleFormat (339) SHORT (3) 1<1>
>>
>>
>> Obviously, the library does not support this, but what are my options 
>> if I need to read this file? I'm not too keen to write a tiff-parser
>> myself, unless I really really have to - and - I afraid - I really 
>> really have to read this file in one way or another.
>>
>> Is there a way to get at least hands on the raw stripe data without 
>> the lib falling over? Failing that, what is the patch acceptance policy
>> for libTIFF? Would you accept a patch that adds support for this, 
>> probably in a limited way?
>
> Thomas,
>
> Have you investigated using TIFFReadRawTile() to read these tiles?   At
> what point does libtiff fail with this file?
Do I misunderstand this? The file isn't tiled, but striped, thus why 
would TIFFReadRawTile() help?
Anyhow, I don't even get that far, the code already fails at TIFFOpen():

 tfd = TIFFOpen(basename,"r");
    if (tfd == NULL)
      PostError("failed to open the TIFF file %s\n",basename);  // <--- 
goes here immediately.

(From my code).
> I don't anticipate the regular decompression/decoding logic working with
> such a file in the near future, but I would like to see it be possible
> to fetch the raw tile/strip data without too much difficulty.
That's what I would basically need. The file is uncompressed, i.e. the 
data is in a single stripe, bit-packed
as five bits red, six bits green, five bits blue. I assume this is 
tiff-conforming, but please look into the
file yourself.
> Can you make one of these files available?
Certainly, please find it attached.

Note that this was created by a custom tiff writer. I *assume* its the 
proper way of creating such a tiff file, but I don't know.
Would be great if you could look into this.

Thanks,
Thomas