diff --git a/tools/tiffsplit.c b/tools/tiffsplit.c index cca3696a..c9734fa3 100644 --- a/tools/tiffsplit.c +++ b/tools/tiffsplit.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiffsplit.c,v 1.4 2004-01-26 17:00:56 dron Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/tools/tiffsplit.c,v 1.5 2004-02-26 10:14:19 dron Exp $ */ /* * Copyright (c) 1992-1997 Sam Leffler @@ -137,7 +137,7 @@ newfilename(void) static int tiffcp(TIFF* in, TIFF* out) { - short bitspersample, samplesperpixel, shortv, *shortav; + uint16 bitspersample, samplesperpixel, compression, shortv, *shortav; uint32 w, l; float floatv; char *stringv; @@ -149,13 +149,18 @@ tiffcp(TIFF* in, TIFF* out) CopyField(TIFFTAG_IMAGEWIDTH, w); CopyField(TIFFTAG_IMAGELENGTH, l); CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample); - CopyField(TIFFTAG_COMPRESSION, shortv); + CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); + CopyField(TIFFTAG_COMPRESSION, compression); + if (compression == COMPRESSION_JPEG) { + uint16 count; + void *table; + TIFFGetField(in, TIFFTAG_JPEGTABLES, &count, &table); + TIFFSetField(out, TIFFTAG_JPEGTABLES, count, table); + } CopyField(TIFFTAG_PREDICTOR, shortv); - CopyField(TIFFTAG_PHOTOMETRIC, shortv); CopyField(TIFFTAG_THRESHHOLDING, shortv); CopyField(TIFFTAG_FILLORDER, shortv); CopyField(TIFFTAG_ORIENTATION, shortv); - CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel); CopyField(TIFFTAG_MINSAMPLEVALUE, shortv); CopyField(TIFFTAG_MAXSAMPLEVALUE, shortv); CopyField(TIFFTAG_XRESOLUTION, floatv);