shithub: pdffs

Download patch

ref: f001da4914eb8fec6539329a08bf1c1a52bee655
parent: a6c9e64221b8553899fddb25dc3b14e989be752d
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Apr 9 09:21:52 EDT 2021

ccittfax: bps is always 1

--- a/f_ccittfax.c
+++ b/f_ccittfax.c
@@ -56,7 +56,7 @@
 		.de = {
 			[DImageWidth] = { 256, Tlong, 1, 0 },
 			[DImageLength] = { 257, Tlong, 1, 0 },
-			[DBitsPerSample] = { 258, Tshort, 1, 0 },
+			[DBitsPerSample] = { 258, Tshort, 1, 1 },
 			[DCompression] = { 259, Tshort, 1, 4 }, /* 4 ≡ ITU-T T.6 */
 			[DPhotometricInterpretation] = { 262, Tshort, 1, 0 }, /* 0 ≡ WhiteIsZero, 1 ≡ BlackIsZero */
 			[DStripOffsets] = { 273, Tlong, 1, sizeof(Header) },
@@ -93,7 +93,6 @@
 	parms = dictget(o, "DecodeParms");
 	h->ifd.de[DImageWidth].v = dictint(parms, "Columns");
 	h->ifd.de[DImageLength].v = dictint(parms, "Rows");
-	h->ifd.de[DBitsPerSample].v = dictint(o, "BitsPerComponent");
 	h->ifd.de[DPhotometricInterpretation].v = !dictint(parms, "BlackIs1");
 	h->ifd.de[DRowsPerStrip].v = h->ifd.de[DImageLength].v;
 	f->aux = h;