summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/libtiff/tiff2pdf-compression.patch
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/libtiff/tiff2pdf-compression.patch')
-rw-r--r--abs/core-testing/libtiff/tiff2pdf-compression.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/abs/core-testing/libtiff/tiff2pdf-compression.patch b/abs/core-testing/libtiff/tiff2pdf-compression.patch
new file mode 100644
index 0000000..2dae2dc
--- /dev/null
+++ b/abs/core-testing/libtiff/tiff2pdf-compression.patch
@@ -0,0 +1,44 @@
+--- tiff-3.8.2/tools/tiff2pdf.c 8 Jun 2006 11:27:11 -0000 1.35
++++ tiff-3.8.2/tools/tiff2pdf.c 19 Jun 2006 20:12:08 -0000 1.36
+@@ -937,7 +937,7 @@
+
+ #ifdef JPEG_SUPPORT
+ if(t2p->pdf_defaultcompression==T2P_COMPRESS_JPEG){
+- if(t2p->pdf_defaultcompressionquality<100 ||
++ if(t2p->pdf_defaultcompressionquality>100 ||
+ t2p->pdf_defaultcompressionquality<1){
+ t2p->pdf_defaultcompressionquality=0;
+ }
+@@ -945,25 +945,17 @@
+ #endif
+ #ifdef ZIP_SUPPORT
+ if(t2p->pdf_defaultcompression==T2P_COMPRESS_ZIP){
+- switch (t2p->pdf_defaultcompressionquality){
+- case 1: case 10: case 11: case 12: case 13: case 14: case 15:
+- case 101: case 110: case 111: case 112: case 113: case 114: case 115:
+- case 201: case 210: case 211: case 212: case 213: case 214: case 215:
+- case 301: case 310: case 311: case 312: case 313: case 314: case 315:
+- case 401: case 410: case 411: case 412: case 413: case 414: case 415:
+- case 501: case 510: case 511: case 512: case 513: case 514: case 515:
+- case 601: case 610: case 611: case 612: case 613: case 614: case 615:
+- case 701: case 710: case 711: case 712: case 713: case 714: case 715:
+- case 801: case 810: case 811: case 812: case 813: case 814: case 815:
+- case 901: case 910: case 911: case 912: case 913: case 914: case 915:
+- break;
+- default:
+- t2p->pdf_defaultcompressionquality=0;
++ uint16 m=t2p->pdf_defaultcompressionquality%100;
++ if(t2p->pdf_defaultcompressionquality/100 > 9 ||
++ (m>1 && m<10) || m>15){
++ t2p->pdf_defaultcompressionquality=0;
+ }
+ if(t2p->pdf_defaultcompressionquality%100 !=0){
++ t2p->pdf_defaultcompressionquality/=100;
++ t2p->pdf_defaultcompressionquality*=100;
+ TIFFError(
+ TIFF2PDF_MODULE,
+- "PNG Group predictor differencing not implemented, assuming compresion quality %u",
++ "PNG Group predictor differencing not implemented, assuming compression quality %u",
+ t2p->pdf_defaultcompressionquality);
+ }
+ t2p->pdf_defaultcompressionquality%=100;