From c0b89ac5bfb90835ef01573267020e42d4fe070c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 23 Aug 2015 12:17:05 +0200 Subject: Imported Upstream version 1.8.0 --- imdi/cctiff.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 imdi/cctiff.c (limited to 'imdi/cctiff.c') diff --git a/imdi/cctiff.c b/imdi/cctiff.c old mode 100644 new mode 100755 index 6c6f64f..32dc5e8 --- a/imdi/cctiff.c +++ b/imdi/cctiff.c @@ -130,6 +130,7 @@ void usage(char *diag, ...) { fprintf(stderr," -a Read and Write planes > 4 as alpha planes\n"); fprintf(stderr," -I Ignore any file or profile colorspace mismatches\n"); fprintf(stderr," -D Don't append or set the output TIFF or JPEG description\n"); + fprintf(stderr," -N Output uncompressed TIFF (default LZW)\n"); fprintf(stderr," -e profile.[%s | tiff | jpg] Optionally embed a profile in the destination TIFF or JPEG file.\n",ICC_FILE_EXT_ND); fprintf(stderr,"\n"); fprintf(stderr," Then for each profile in sequence:\n"); @@ -664,6 +665,7 @@ struct _profinfo { typedef struct { /* Overall parameters */ int verb; /* Non-zero if verbose */ + int compr; /* NZ to use TIFF LZW */ icColorSpaceSignature ins, outs; /* Input/Output spaces */ int iinv, oinv; /* Space inversion */ int id, od, md; /* Input/Output dimensions and max(id,od) */ @@ -1043,6 +1045,7 @@ main(int argc, char *argv[]) { /* Set defaults */ memset((void *)&su, 0, sizeof(sucntx)); + su.compr = 1; /* TIFF LZW by default */ next_intent = icmDefaultIntent; next_func = icmFwd; next_order = icmLuOrdNorm; @@ -1213,6 +1216,10 @@ main(int argc, char *argv[]) { else if (argv[fa][1] == 'D') nodesc = 1; + else if (argv[fa][1] == 'N') + su.compr = 0; + + /* Verbosity */ else if (argv[fa][1] == 'v' || argv[fa][1] == 'V') { su.verb = 1; @@ -1655,7 +1662,11 @@ main(int argc, char *argv[]) { TIFFSetField(wh, TIFFTAG_BITSPERSAMPLE, bitspersample); TIFFSetField(wh, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - TIFFSetField(wh, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + if (su.compr) + TIFFSetField(wh, TIFFTAG_COMPRESSION, COMPRESSION_LZW); + else + TIFFSetField(wh, TIFFTAG_COMPRESSION, COMPRESSION_NONE); + if (resunits) { TIFFSetField(wh, TIFFTAG_RESOLUTIONUNIT, resunits); TIFFSetField(wh, TIFFTAG_XRESOLUTION, resx); -- cgit v1.2.3