]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 1 Oct 2009 13:14:28 +0000 (13:14 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 1 Oct 2009 13:14:28 +0000 (13:14 +0000)
ChangeLog
coders/tiff.c

index a083e9798495522994158b14818d210d8eedbcdf..16b88028482991bdeafa4b84e1b86dae48ff73f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-10-01  6.5.6-7 Cristy  <quetzlzacatenango@image...>
+  * Don't use group4 compression if the image is truecolor.
+
 2009-09-25  6.5.6-6 Cristy  <quetzlzacatenango@image...>
   * Permit percentage of hue for HSL (e.g. hsl(12%,...)).
 
index bd21f440b30961e65b9efc35f7b203e9b98c7c36..f25ead3f24b63d0c8560765097e05703da203eac 100644 (file)
@@ -105,7 +105,7 @@ static const ExifInfo
     { EXIFTAG_FNUMBER, TIFF_RATIONAL, "exif:FNumber" },
     { EXIFTAG_EXPOSUREPROGRAM, TIFF_SHORT, "exif:ExposureProgram" },
     { EXIFTAG_SPECTRALSENSITIVITY, TIFF_ASCII, "exif:SpectralSensitivity" },
-    { EXIFTAG_ISOSPEEDRATINGS, TIFF_SHORT, "exif:ISOSpeedRatings" }, 
+    { EXIFTAG_ISOSPEEDRATINGS, TIFF_SHORT, "exif:ISOSpeedRatings" },
     { EXIFTAG_OECF, TIFF_UNDEFINED, "exif:OptoelectricConversionFactor" },
     { EXIFTAG_EXIFVERSION, TIFF_UNDEFINED, "exif:ExifVersion" },
     { EXIFTAG_DATETIMEORIGINAL, TIFF_ASCII, "exif:DateTimeOriginal" },
@@ -1877,7 +1877,7 @@ static MagickBooleanType WriteGROUP4Image(const ImageInfo *image_info,
   file=(FILE *) NULL;
   unique_file=AcquireUniqueFileResource(filename);
   if (unique_file != -1)
-    file=fdopen(unique_file,"wb"); 
+    file=fdopen(unique_file,"wb");
   if ((unique_file == -1) || (file == (FILE *) NULL))
     {
       ThrowFileException(&image->exception,FileOpenError,
@@ -2600,7 +2600,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       default:
         break;
     }
-    (void) TIFFSetField(tiff,TIFFTAG_COMPRESSION,compress_tag);
     if (image->colorspace == CMYKColorspace)
       {
         photometric=PHOTOMETRIC_SEPARATED;
@@ -2668,6 +2667,47 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
                 }
           }
       }
+    switch (image->endian)
+    {
+      case LSBEndian:
+      {
+        endian=FILLORDER_LSB2MSB;
+        break;
+      }
+      case MSBEndian:
+      {
+        endian=FILLORDER_MSB2LSB;
+        break;
+      }
+      case UndefinedEndian:
+      default:
+      {
+        (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian);
+        break;
+      }
+    }
+    lsb_first=1;
+    image->endian=MSBEndian;
+    if ((int) (*(char *) &lsb_first) != 0)
+      image->endian=LSBEndian;
+    if ((compress_tag == COMPRESSION_JPEG) && (photometric != PHOTOMETRIC_RGB))
+      compress_tag=COMPRESSION_NONE;
+    else
+      if ((compress_tag == COMPRESSION_CCITTFAX3) &&
+          (photometric != PHOTOMETRIC_MINISWHITE))
+        {
+          compress_tag=COMPRESSION_NONE;
+          endian=FILLORDER_MSB2LSB;
+        }
+      else
+        if ((compress_tag == COMPRESSION_CCITTFAX4) &&
+           (photometric != PHOTOMETRIC_MINISWHITE))
+         {
+           compress_tag=COMPRESSION_NONE;
+           endian=FILLORDER_MSB2LSB;
+         }
+    (void) TIFFSetField(tiff,TIFFTAG_COMPRESSION,compress_tag);
+    (void) TIFFSetField(tiff,TIFFTAG_FILLORDER,endian);
     (void) TIFFSetField(tiff,TIFFTAG_BITSPERSAMPLE,quantum_info->depth);
     if (image->matte != MagickFalse)
       {
@@ -2716,30 +2756,6 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info,
       default:
         break;
     }
-    switch (image->endian)
-    {
-      case LSBEndian:
-      {
-        endian=FILLORDER_LSB2MSB;
-        break;
-      }
-      case MSBEndian:
-      {
-        endian=FILLORDER_MSB2LSB;
-        break;
-      }
-      case UndefinedEndian:
-      default:
-      {
-        (void) TIFFGetFieldDefaulted(tiff,TIFFTAG_FILLORDER,&endian);
-        break;
-      }
-    }
-    lsb_first=1;
-    image->endian=MSBEndian;
-    if ((int) (*(char *) &lsb_first) != 0)
-      image->endian=LSBEndian;
-    (void) TIFFSetField(tiff,TIFFTAG_FILLORDER,endian);
     (void) TIFFSetField(tiff,TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
     (void) TIFFSetField(tiff,TIFFTAG_PLANARCONFIG,PLANARCONFIG_CONTIG);
     if (photometric == PHOTOMETRIC_RGB)