Permalink
Browse files

libtiff does not handle well finding a TIFFTAG_PREDICTOR in uncompres…

…sed images so we won't ask it unless DEFLATE is being used. Fix bug #1753
  • Loading branch information...
1 parent 1ee4732 commit 0f7931322dbfc2be48b0ff84a183b374e15cc67d @spouliot spouliot committed Nov 9, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/tiffcodec.c
View
@@ -219,6 +219,7 @@ gdip_load_tiff_properties (TIFF *tiff, BitmapData *bitmap_data)
uint32 rows_per_strip;
uint32 tile_length;
uint32 tile_width;
+ uint16 compression = 0;
samples_per_pixel = 0;
bits_per_sample = 0;
@@ -269,6 +270,7 @@ gdip_load_tiff_properties (TIFF *tiff, BitmapData *bitmap_data)
}
if (TIFFGetField(tiff, TIFFTAG_COMPRESSION, &s)) {
+ compression = s;
gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagCompression, s);
}
@@ -393,8 +395,10 @@ gdip_load_tiff_properties (TIFF *tiff, BitmapData *bitmap_data)
gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPlanarConfig, planar_configuration);
}
- if (TIFFGetField(tiff, TIFFTAG_PREDICTOR, &s)) {
- gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPredictor, s);
+ if (compression == COMPRESSION_ADOBE_DEFLATE) {
+ if (TIFFGetField(tiff, TIFFTAG_PREDICTOR, &s)) {
+ gdip_bitmapdata_property_add_short(bitmap_data, PropertyTagPredictor, s);
+ }
}
{

0 comments on commit 0f79313

Please sign in to comment.