fixed CMYK problem in getimage

This commit is contained in:
Frank Warmerdam 2001-08-28 13:11:38 +00:00
parent 7afe0a69bc
commit abf486d1fa
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2001-08-28 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tif_getimage.c: Don't complain for CMYK (separated)
images with more than four samples per pixel. See:
http://bugzilla.remotesensing.org/show_bug.cgi?id=73
2001-08-10 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tif_getimage.c: Use memmove() instead of TIFFmemcpy()

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v 1.11 2001-08-11 03:41:07 warmerda Exp $ */
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_getimage.c,v 1.12 2001-08-28 13:11:38 warmerda Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -111,7 +111,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
"InkSet", td->td_inkset);
return (0);
}
if (td->td_samplesperpixel != 4) {
if (td->td_samplesperpixel < 4) {
sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
"Samples/pixel", td->td_samplesperpixel);
return (0);
@ -280,6 +280,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
/* can rely on libjpeg to convert to RGB */
/* XXX should restore current state on exit */
switch (compress) {
case COMPRESSION_OJPEG:
case COMPRESSION_JPEG:
TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);
img->photometric = PHOTOMETRIC_RGB;
@ -305,7 +306,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
"InkSet", inkset);
return (0);
}
if (img->samplesperpixel != 4) {
if (img->samplesperpixel < 4) {
sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
"Samples/pixel", img->samplesperpixel);
return (0);