Re: [PATCH] fix jbig in tiff container

Bob Friesenhahn <[email protected]> Mon, 22 Dec 2014 20:59:05 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <[email protected]>
On Mon, 22 Dec 2014, Yuriy Kaminskiy wrote:

> libtiff jbig (en|de)coder supports only TIFFReadEncodedStrip (and encoder only
> supports single whole-image strip); gm tries to use either ScanlineMethod, or
> StripMethod depending on strip size in decoder, and always use ScanlineMethod in
> encoder. Decoder fails with larger samples, encoder always fails. Force
> StripMethod in tiff decoder for JBIG codec.
>
> Unsolved: encoder side.
>
> Samples for testing can be obtained by converting bi-level tiff to jbig by
> tiffcp -r -1 -c jbig in-ccitt-g4.tiff out-jbig.tiff

I had forgotten about this problem.

While the GraphicsMagick TIFF writer obviously needs a strip-writer 
(which is much more than a small patch), it seems that the problems 
are deeper since 'tiffcp' has the same problem:

% tiffcp -r -1 -c jbig golfer-150-bilevel.tiff golfer-150-bilevel-jbig.tiff
golfer-150-bilevel-jbig.tiff: ISO JBIG scanline encoding is not implemented.
golfer-150-bilevel-jbig.tiff: Error, can't write scanline 0.

I commited a possible fix for the reader issue (not able to properly 
test) via Mercurial changeset c62696363b2f.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net