AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.12.12 22:19 "[Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.12 22:49 "Re: [Tiff] Writing EXIF data?", by Bob Friesenhahn
2005.12.12 22:57 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.12 23:47 "Re: [Tiff] Writing EXIF data?", by Bob Friesenhahn
2005.12.13 02:15 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 05:22 "Re: [Tiff] Writing EXIF data?", by Bob Friesenhahn
2005.12.13 07:43 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 08:57 "Re: [Tiff] Writing EXIF data?", by Andrey Kiselev
2005.12.13 16:28 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 17:22 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 18:16 "Re: [Tiff] Writing EXIF data?", by Bob Friesenhahn
2005.12.13 05:24 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 07:49 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 15:07 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 17:31 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 18:08 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 18:13 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 21:08 "Re: [Tiff] Writing EXIF data?", by Andrey Kiselev
2006.01.01 21:13 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.01 16:57 "[Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.01 18:02 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.01 18:50 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.02 16:08 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.03 00:27 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Jay Berkenbilt
2006.01.03 02:31 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.04 13:23 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Andrey Kiselev
2006.01.04 16:18 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Bob Friesenhahn
2006.01.07 02:59 "Re: [Tiff] Outrageous profile tag sizes reported by libtiff 3.8.0", by Jay Berkenbilt
2006.01.17 07:43 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Patryk Palasz
2006.01.16 15:10 "[Tiff] TiffReadEncodedStrip - problem in Delphi", by Patryk Palasz
2006.01.16 15:33 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Bob Friesenhahn
2006.01.17 18:53 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Joris Van Damme
2006.01.17 20:17 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Patryk Palasz
2006.01.17 20:31 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Bob Friesenhahn
2005.12.13 18:16 "Re: [Tiff] Writing EXIF data?", by Joshua Muskovitz
2005.12.13 18:19 "Re: [Tiff] Writing EXIF data?", by Joshua Muskovitz
2005.12.13 20:23 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 18:40 "Re: [Tiff] Writing EXIF data?", by Chris Losinger
2005.12.22 19:22 "[Tiff] filtering TIFF tags", by Chris Losinger
2005.12.22 19:41 "Re: [Tiff] filtering TIFF tags", by Joris Van Damme
2005.12.22 19:58 "Re: [Tiff] filtering TIFF tags", by Chris Losinger
2005.12.22 22:02 "Re: [Tiff] filtering TIFF tags", by Frank Warmerdam
2005.12.22 22:46 "Re: [Tiff] filtering TIFF tags", by Bob Friesenhahn
2005.12.23 20:27 "Re: [Tiff] filtering TIFF tags", by Andrey Kiselev
2005.12.13 18:25 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 19:49 "Re: [Tiff] Writing EXIF data?", by
2005.12.13 20:27 "Re: [Tiff] Writing EXIF data?", by Joris Van Damme
2005.12.13 21:24 "Re: [Tiff] Writing EXIF data?", by
2005.12.13 20:04 "Re: [Tiff] Writing EXIF data?", by Paul J. Lucas
2005.12.13 20:47 "Re: [Tiff] Writing EXIF data?", by Andrey Kiselev

2006.01.17 20:17 "Re: [Tiff] TiffReadEncodedStrip - problem in Delphi", by Patryk Palasz

Nevertheless, Bob is right. You should in no case reverse bits - LibTiff is doing it for you, and so you repeating that work in your own code is in vain and in error, even if it doesn't influence the decoding of this particular file. So it is best to note.

OK - you are both right. Simply I didn't know about TiffReverseBit - so I wrote my own - of course unecesarly :)

Apart from the unwanted bitorder swapping thing, there are at least two other problem here.

  1. If the decoding of a particular strip fails, your BitmapBuff pointer is not incremented. Thus, the following strip gets read in a position that is too high. A better solution would involve filling the 'error area' with an 'error color', which may be white, and reading the next strip in the proper position.

Right - but it is not easy to find out the size of not decoded stripe.

  1. TIFFReadEncodedStrip aligns each line on a byte boundary, as is customary in TIFF. However, in a Windows DIB lines are aligned on 32bit boundaries.

This is the answer I was waiting for! :) Thank you very much! Can I ask what are the other differences (except line order and 32bit aligned)

between TIFF strip and Windows DIB (VCL Bitmap)?

  1. To cure your problem, I recommend reading strips into a temporary buffer. Instead of the ChangeLinesOrder routine, copy lines one by one from this temporary buffer to your bitmap, taking into account that

> lines in the temporary buffer are byte aligned.

In fact ChangeLinesOrder did what you sugested (Buff variable is reused temporary buffer),

but I treated BitmapBuff as a regular buffer instead of using Bitmap.ScanLine property to write a single line.

I have one more question. Do you think that using TiffReadScanline could improve the reading performance (or at least would have the same performance)? In case of one-strip big files temporary buffer becomes quite ...big - that's why I think about TiffReadScanline.

Once again - thank you very much.

Best regards - Patryk Palasz.