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
February 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.02.20 07:54 "TIFFReadScanline query", by <benarestham@gmail.com>
2006.02.20 21:20 "Re: TIFFReadScanline query", by Chris Cox
2006.02.21 03:50 "Re: TIFFReadScanline query", by <benarestham@gmail.com>
2006.02.21 05:39 "Re: TIFFReadScanline query", by Charles Auer
2006.02.21 05:54 "Re: TIFFReadScanline query", by Joris Van Damme
2006.02.22 12:45 "Re: TIFFReadScanline query", by <benarestham@gmail.com>

2006.02.21 05:54 "Re: TIFFReadScanline query", by Joris Van Damme

Benares,

I can't seem to get my head around why you get the results you do, given
the code (and bug) that you've quoted, or not entirely anyway, but maybe
that's just lack of caffeïne... In any case, there is a bug in the code
you've quoted.

- Your basic problem is that you're not dealing with bytes given to you
in line_buffer, but are indexing uint32 values in that buffer instead.
So declare line_buffer to be an uint8*, or equivalent (you C guys custom
redefining basic types all the time, it's hard to tell how to properly
name a simple pointer to a byte). The rest of your code seems designed
fine on the condition that you declare line_buffer to be an uint8*
instead.
- Allocate only ScanlineSize bytes for line_buffer, not
ScanlineSize*sizeof(uint32). (But cure above problem first, or you'll
have an access violation on your hands.)
- How can you be sure a<<8<<8 equals (a<<8)<<8? It seems that way, from
the results you get, I think, but how you C guys manage to keep track of
the priority of your set of thousands of such operations, and know for
sure such stuff doesn't instead  equal a<<(8<<8) is beyond me.

As to your input file itself, it's monstorous. The very much invalid
flawed content of Kodak DC290 files has been described on the list
before (see http://www.asmail.be/msg0054881737.html). I've
double-checked, and your input file seems to follow that same layout.


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