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 2005

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

2005.10.14 10:47 "Repair ImageLength of fax file", by Ulf Zibis
2005.10.14 16:05 "Re: Repair ImageLength of fax file", by Joris Van Damme
2005.10.17 14:14 "Re: Repair ImageLength of fax file", by Ulf Zibis
2005.10.18 08:09 "Re: Repair ImageLength of fax file", by Joris Van Damme
2005.10.19 01:55 "Re: Repair ImageLength of fax file", by Joris Van Damme

2005.10.14 16:05 "Re: Repair ImageLength of fax file", by Joris Van Damme

Ulf,

Ulf Zibis wrote:
> I suppose, the reason is the missing ImageLength (see dump below). Is
> there any chance to calculate the correct value.

Yes, there is, but it's so much trouble it may not be worth it.

G3 compressed data has EOL markers in it. It should start with an EOL
marker (but a common error is to ommit the first EOL), and next give
another EOL marker after each compressed line. In my opinion, it should
end with a single EOL marker after the last line, but sources are not
clear on this and you may see a variable number of EOLs after the last
line, anything from 0 to 6.

An EOL marker is 12 bits, and goes like 000000000001. That pattern
cannot occur in the actual compressed data. So scanning through the
compressed data, counting the occurences of this pattern, making sure to
deal with the first EOL or its absense, and the last EOL sequence
specifically, you could derive an appropriate value for ImageLength.

Is it worth it? Do you have many such images that need decoding, or a
buggy source you can't fix?


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