- 2014.12.27 22:30 "[Tiff] [PATCH] tiff2pdf fixes for grayscale (min-is-white/black) and alpha", by Yuriy M. Kaminskiy
- 2014.12.29 22:29 "[Tiff] [PATCH] Signal error on unsupported sample/bit-depth in jbig codec instead of silently producing garbage", by Yuriy M. Kaminskiy
-
2014.12.30 20:41 "[Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
-
2014.12.30 20:55 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
- 2014.12.30 21:45 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
- 2014.12.31 14:33 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Olivier Paquet
- 2015.01.04 23:02 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Yuriy M. Kaminskiy
- 2014.12.31 09:36 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
-
2014.12.30 20:55 "Re: [Tiff] [PATCH] tif_luv, tif_pixarlog, ppm2tiff: get rid of duplicates of TIFFSafeMultiply", by Jürgen_Buchmüller
- 2015.01.25 16:56 "[Tiff] [security][PATCH] tiff2pdf: fix snprintf return value misuse", by Yuriy M. Kaminskiy
2014.12.29 22:29 "[Tiff] [PATCH] Signal error on unsupported sample/bit-depth in jbig codec instead of silently producing garbage", by Yuriy M. Kaminskiy
Note: this only reflects tif_jbig.c implementation limitation, not inherent limitation of jbig codec. JBIG codec (and jbigkit library) supports non-bilevel compression (however, most likely it will compress worse than Deflate and will be *much* slower).
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
NotDashEscaped: You need GnuPG to verify this message
Index: tiff-4.0.x-20141215/libtiff/tif_jbig.c
===================================================================
--- tiff-4.0.x-20141215.orig/libtiff/tif_jbig.c 2014-12-24 00:37:35.216597505 +0300
+++ tiff-4.0.x-20141215/libtiff/tif_jbig.c 2014-12-24 00:39:40.620097398 +0300
@@ -39,7 +39,18 @@
static int JBIGSetupDecode(TIFF* tif)
{
- if (TIFFNumberOfStrips(tif) != 1)
+ TIFFDirectory* td = &tif->tif_dir;
+ if (td->td_bitspersample != 1) {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "%d bits/sample is not supported in decoder", td->td_bitspersample);
+ return (0);
+ }
+ if (td->td_planarconfig != PLANARCONFIG_SEPARATE && td->td_samplesperpixel != 1) {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "%d samples/pixel is not supported in decoder", td->td_bitspersample);
+ return (0);
+ }
+ if (TIFFNumberOfStrips(tif) != (td->td_planarconfig == PLANARCONFIG_SEPARATE ? td->td_samplesperpixel : 1))
{
TIFFErrorExt(tif->tif_clientdata, "JBIG", "Multistrip images not supported in decoder");
return 0;
@@ -105,7 +116,18 @@ static int JBIGDecode(TIFF* tif, uint8*
static int JBIGSetupEncode(TIFF* tif)
{
- if (TIFFNumberOfStrips(tif) != 1)
+ TIFFDirectory* td = &tif->tif_dir;
+ if (td->td_bitspersample != 1) {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "%d bits/sample is not supported in encoder", td->td_bitspersample);
+ return (0);
+ }
+ if (td->td_planarconfig != PLANARCONFIG_SEPARATE && td->td_samplesperpixel != 1) {
+ TIFFErrorExt(tif->tif_clientdata, "JBIG",
+ "%d samples/pixel is not supported in encoder", td->td_bitspersample);
+ return (0);
+ }
+ if (TIFFNumberOfStrips(tif) != (td->td_planarconfig == PLANARCONFIG_SEPARATE ? td->td_samplesperpixel : 1))
{
TIFFErrorExt(tif->tif_clientdata, "JBIG", "Multistrip images not supported in encoder");
return 0;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iF4EAREIAAYFAlSh1VAACgkQKZn9iF16KMOSFwD/aAA+ZHdq1uvBuOd/A/6MCBqe n/J2SLH9c+9JBGgmzmMBAI01jsPICYtY9aLuYvgjeKhyue+hjZcrMaa6tDJ0DJZC
=H0v7
-----END PGP SIGNATURE-----