PKGBUILDs/extra/libtiff/tiff2pdf-compression.patch
2009-09-26 09:35:50 -05:00

44 lines
2 KiB
Diff

--- 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;