2015.01.25 16:34 "Re: [Tiff] How to generate JBIG encoded TIFFs?", by Yuriy Kaminskiy
Hello List,
I compiled libtiff with JBIG support, but I can't get tiffcp to write the output JBIG encoded (and yes, the input is bi-level data).
If I try to control the conversion with the -t/-s/-r/-l/-w flags, I get varying error messages, but in no case tiffcp writes any output (see log attached).
Is this supposed to work?
- litiff/tif_jbig.c only supports encoding and decoding single-strip JBIG images (implementation limitation, there are no such limitation in standard); tiled encoding is also not supported.
- tif_jbig does not support anything other than 1 bit-per-sample, 1 samples-per-pixel, min-is-black or min-is-white and silently produces garbage for unsupported bps/spp combinations (also implementation limitation and bug);
- when changing strip size, tiffcp uses by-scanline conversion, which is not supported by tif_jbig.
So, you should first convert file to single-strip layout:
tiffcp -r-1 test-in.tiff tmp.tiff
... and then recompress it to jbig:
tiffcp -c jbig tmp.tiff test-out.tiff
I've posted some patches for 2 and 3, but they were ignored so far.