Changeset 13659
- Timestamp:
- 02/01/08 16:53:51 (3 months ago)
- Files:
-
- branches/1.5/gdal/frmts/gtiff/geotiff.cpp (modified) (3 diffs)
- branches/1.5/gdal/frmts/gtiff/libtiff/tif_jpeg.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.5/gdal/frmts/gtiff/geotiff.cpp
r13409 r13659 1900 1900 if( nLoadedBlock == nBlockId ) 1901 1901 return CE_None; 1902 1903 /* -------------------------------------------------------------------- */1904 /* This is rather overkill, but relatively harmless so we do it */1905 /* here to be sure. */1906 /* -------------------------------------------------------------------- */1907 if( nCompression == COMPRESSION_JPEG1908 && nPhotometric == PHOTOMETRIC_YCBCR1909 && CSLTestBoolean( CPLGetConfigOption("CONVERT_YCBCR_TO_RGB",1910 "YES") ) )1911 {1912 TIFFSetField(hTIFF, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);1913 }1914 1902 1915 1903 /* -------------------------------------------------------------------- */ … … 3101 3089 nPhotometric == PHOTOMETRIC_LOGLUV || 3102 3090 ( nPhotometric == PHOTOMETRIC_YCBCR 3103 && CSLTestBoolean( CPLGetConfigOption("CONVERT_YCBCR_TO_RGB", 3104 "YES") )) ) 3091 && nCompression != COMPRESSION_JPEG ) ) 3105 3092 { 3106 3093 char szMessage[1024]; … … 3117 3104 } 3118 3105 3106 /* -------------------------------------------------------------------- */ 3107 /* YCbCr JPEG compressed images should be translated on the fly */ 3108 /* to RGB by libtiff/libjpeg unless specifically requested */ 3109 /* otherwise. */ 3110 /* -------------------------------------------------------------------- */ 3111 if( nCompression == COMPRESSION_JPEG 3112 && nPhotometric == PHOTOMETRIC_YCBCR 3113 && CSLTestBoolean( CPLGetConfigOption("CONVERT_YCBCR_TO_RGB", 3114 "YES") ) ) 3115 { 3116 TIFFSetField(hTIFF, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); 3117 } 3118 3119 3119 /* -------------------------------------------------------------------- */ 3120 3120 /* Should we treat this via the odd bits interface? */ branches/1.5/gdal/frmts/gtiff/libtiff/tif_jpeg.c
r13310 r13659 1 /* $Id: tif_jpeg.c,v 1.7 5 2007/12/10 19:58:41fwarmerdam Exp $ */1 /* $Id: tif_jpeg.c,v 1.76 2008/02/01 21:50:24 fwarmerdam Exp $ */ 2 2 3 3 /* … … 682 682 static const char module[] = "JPEGFixupTagsSubsampling"; 683 683 struct JPEGFixupTagsSubsamplingData m; 684 685 if( tif->tif_dir.td_stripbytecount == NULL 686 || tif->tif_dir.td_stripbytecount[0] == 0 ) 687 { 688 /* Do not even try to check if the first strip/tile does not 689 yet exist, as occurs when GDAL has created a new NULL file 690 for instance. */ 691 return; 692 } 693 684 694 m.tif=tif; 685 695 m.buffersize=2048;
