2005.07.28 15:32 "[Tiff] Problems with MS Windows generated tiff files", by Ian Thurlbeck

2005.08.26 03:20 "Re: [Tiff] TIFF Thumbnail", by Joris Van Damme

Katrina, Folks,

Joris wrote:
> If the file is under 1 megabyte in size, you may send it to my
> personal e-mail address, and I'll take a closer look.

Katrina has send me a file to look at... It is an extremely weird TIFF
if ever I saw one. Here's next a complete tagdump, and my comments on it
below:

File "P0000049.TIF"
   Byte order: Motorola

    Format: Classic TIFF

IFD Tree

Page 0 at offset 8
   SubIFD 0 at offset 22724
   SubIFD 1 at offset 22920
   Exif IFD at offset 636
Page 1 at offset 4096

Page 0
      Offset: 8
      Next IFD: 4096

NewSubfileType (1 LONG): -

ImageWidth (1 SHORT): 1792
ImageLength (1 SHORT): 1200
BitsPerSample (3 SHORT): 8, 8, 8

Compression (1 SHORT): No compression

PhotometricInterpretation (1 SHORT): RGB Make (22 ASCII): "Eastman Kodak Company" Model (32 ASCII): "KODAK DC290 Zoom Digital Camera" StripOffsets (1 LONG): 33776 Orientation (1 SHORT): 0th row is top, 0th column is left-hand side

   SamplesPerPixel (1 SHORT): 3
   RowsPerStrip (1 SHORT): 1200
   StripByteCounts (1 LONG): 6451200
   XResolution (1 RATIONAL): 192
   YResolution (1 RATIONAL): 192

ResolutionUnit (1 SHORT): Inch

   SubIFDs (2 LONG): 22724, 22920
   33426 (0 LONG):
   Copyright (33 ASCII): "(c) 1999 FlashPoint Technology  "
   33434 (1 RATIONAL): 0,0166666666666667
   33437 (1 RATIONAL): 2,8
   Exif IFD (1 LONG): 636
   36867 (20 ASCII): "1999:07:13 06:04:43"
   37377 (1 SRATIONAL): 6
   37378 (1 RATIONAL): 3
   37380 (1 SRATIONAL): 0
   37382 (1 RATIONAL): 1,26
   37383 (1 SHORT): 2
   37384 (1 SHORT): 0
   37385 (1 SHORT): 1
   37386 (1 RATIONAL): 0
   41493 (1 RATIONAL): 140
   41495 (1 SHORT): 2

SubIFD 0
      Offset: 22724
      Next IFD: 0
   NewSubfileType (1 LONG): Reduced-resolution version
   ImageWidth (1 SHORT): 96
   ImageLength (1 SHORT): 64
   BitsPerSample (3 SHORT): 0, 0, 0

Compression (1 SHORT): No compression

PhotometricInterpretation (1 SHORT): RGB StripOffsets (1 SHORT): 0

Orientation (1 SHORT): 0th row is top, 0th column is left-hand side

   SamplesPerPixel (1 SHORT): 3
   RowsPerStrip (1 SHORT): 64
   StripByteCounts (1 SHORT): 18432

XResolution (1 RATIONAL): 72
   YResolution (1 RATIONAL): 72
   ResolutionUnit (1 SHORT): Inch

SubIFD 1
      Offset: 22920
      Next IFD: 0
   NewSubfileType (1 LONG): Reduced-resolution version
   ImageWidth (1 SHORT): 288
   ImageLength (1 SHORT): 192
   Compression (1 SHORT): JPEG ('old-style' JPEG, later overriden in
Technote2)

Orientation (1 SHORT): 0th row is top, 0th column is left-hand side

XResolution (1 RATIONAL): 72
   YResolution (1 RATIONAL): 72
   ResolutionUnit (1 SHORT): Inch

JPEGProc (1 SHORT): 1 JPEGInterchangeFormat (1 LONG): 23086 JPEGInterchangeFormatLength (1 LONG): 10689

Exif IFD
      Offset: 636
      Next IFD: 0

   ExposureTime (1 RATIONAL): 0,0166666666666667
   FNumber (1 RATIONAL): 2,8
   ExifVersion (4 UNDEFINED): 2.10

DateTimeOriginal (20 ASCII): "1999:07:13 06:04:43" DateTimeDigitized (20 ASCII): "1999:07:13 06:04:43" ShutterSpeedValue (1 SRATIONAL): 6 ApertureValue (1 RATIONAL): 3 ExposureBiasValue (1 SRATIONAL): 0 MaxApertureValue (1 RATIONAL): 214748364,8 MeteringMode (1 SHORT): CenterWeightedAverage LightSource (1 SHORT): Unknown

Flash (1 SHORT): Flash fired
FocalLength (1 RATIONAL): 0

MakerNote (1024 UNDEFINED): 1, 0, 1, 0, 0, 0, 4, 0, 69, 97, 115,... FlashpixVersion (4 UNDEFINED): 1.00

   ColorSpace (1 SHORT): sRGB
   ExposureIndex (1 RATIONAL): 140

SensingMethod (1 SHORT): One-chip color area sensor FileSource (1 UNDEFINED): Recorded on a DSC SceneType (1 UNDEFINED): Directly photographed

Page 1
      Offset: 4096
      Next IFD: 0
   ImageWidth (1 SHORT): 96
   ImageLength (1 SHORT): 64
   BitsPerSample (3 SHORT): 8, 8, 8

Compression (1 SHORT): No compression

PhotometricInterpretation (1 SHORT): RGB StripOffsets (1 LONG): 4292

Orientation (1 SHORT): 0th row is top, 0th column is left-hand side

   SamplesPerPixel (1 SHORT): 3
   RowsPerStrip (1 SHORT): 64
   StripByteCounts (1 SHORT): 18432

XResolution (1 RATIONAL): 72
   YResolution (1 RATIONAL): 72
   ResolutionUnit (1 SHORT): Inch

So, what's in there?

> samples."
>
> I checked in AsTiffTagViewer, it displayed:
>

> BitsPerSample   Short    3 (count)     8,8,8 (value)

The first refers to SubIFD 0, the second refers to Page 1.

Katrina, this is probably the single worst TIFF I ever saw. It will be
quite a challenge. Some of the stuff is impossible to decode properly
(for instance, it is impossible for code to deduce that IFD 1 is a
reduced resolution version of IFD 0). Other stuff will depend on the
ability of your code to recover from errors in smart ways (for instance,
SubIFD 0 will lead to a decoding error, and so will SubIFD 1 unless you
jump through hoops decoding the illegal old-style JPEG, and smart
decoders must allow proper decoding of IFD 0 even after possibly failing
on these reduced resolution versions). Yet other stuff is rather
arbitrary (for instance, should one use the EXIF info in the image IFD
in this situation, or the EXIF info in the EXIF IFD, or should one merge
these?).

Good luck! If you feel up to it, complaining to the vendor of the
software that writes these monstrous files is the responsible thing to
do. Feel free to use my above comments on the file if you decide to do
so.

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