From 0a02af9e2dab1a17952d2950a901991e79dd36f8 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Tue, 7 Feb 2006 14:28:48 +0000 Subject: [PATCH] fix for non-YCbCr jpeg compressed files --- ChangeLog | 5 +++++ tools/tiff2pdf.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff04caa2..3a40fbec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-07 Frank Warmerdam + + * tools/tiff2pdf.c: Fixed support for non-YCbCr encoded JPEG + compressed TIFF files, per submission from Dan Cobra. + 2006-02-07 Andrey Kiselev * libtiff/{tif_dirread.c, tif_packbits.c, tif_win32.c}: Properly diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c index f9f86fb6..a6d0f560 100644 --- a/tools/tiff2pdf.c +++ b/tools/tiff2pdf.c @@ -1,9 +1,12 @@ -/* $Id: tiff2pdf.c,v 1.25 2005-12-27 12:24:07 dron Exp $ +/* $Id: tiff2pdf.c,v 1.26 2006-02-07 14:28:49 fwarmerdam Exp $ * * tiff2pdf - converts a TIFF image to a PDF document * * $Log: tiff2pdf.c,v $ - * Revision 1.25 2005-12-27 12:24:07 dron + * Revision 1.26 2006-02-07 14:28:49 fwarmerdam + * fix for non-YCbCr jpeg compressed files + * + * Revision 1.25 2005/12/27 12:24:07 dron * Avoid warnings. * * Revision 1.24 2005/09/20 11:19:38 dron @@ -5087,6 +5090,11 @@ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output #ifdef JPEG_SUPPORT case T2P_COMPRESS_JPEG: written += TIFFWriteFile(output, (tdata_t) "/DCTDecode ", 11); + + if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR) { + written += TIFFWriteFile(output, (tdata_t) "/DecodeParms ", 13); + written += TIFFWriteFile(output, (tdata_t) "<< /ColorTransform 0 >>\r", 24); + } break; #endif #ifdef ZIP_SUPPORT