]> granicus.if.org Git - imagemagick/blobdiff - coders/tiff.c
Tietz offset is a Tiff property
[imagemagick] / coders / tiff.c
index 88a4c2c5a56c21775993527db1d16e2c13ac93fb..6616533fc6e22d77324ab1ddd467be6e035ec271 100755 (executable)
@@ -571,9 +571,6 @@ static void TIFFGetProfiles(TIFF *tiff,Image *image,MagickBooleanType ping,
   unsigned char
     *profile;
 
-  unsigned long
-    *tietz;
-
   length=0;
   if (ping == MagickFalse)
     {
@@ -609,9 +606,6 @@ static void TIFFGetProfiles(TIFF *tiff,Image *image,MagickBooleanType ping,
   if ((TIFFGetField(tiff,37724,&length,&profile) == 1) &&
       (profile != (unsigned char *) NULL))
     (void) ReadProfile(image,"tiff:37724",profile,(ssize_t) length,exception);
-  image->tietz_offset=0;
-  if (TIFFGetField(tiff,37706,&length,&tietz) == 1)
-    image->tietz_offset=tietz[0];
 }
 
 static void TIFFGetProperties(TIFF *tiff,Image *image,ExceptionInfo *exception)
@@ -622,8 +616,13 @@ static void TIFFGetProperties(TIFF *tiff,Image *image,ExceptionInfo *exception)
 
   uint32
     count,
+    length,
     type;
 
+  unsigned long
+    *tietz;
+
+
   if (TIFFGetField(tiff,TIFFTAG_ARTIST,&text) == 1)
     (void) SetImageProperty(image,"tiff:artist",text,exception);
   if (TIFFGetField(tiff,TIFFTAG_COPYRIGHT,&text) == 1)
@@ -687,6 +686,11 @@ static void TIFFGetProperties(TIFF *tiff,Image *image,ExceptionInfo *exception)
       default:
         break;
     }
+  if (TIFFGetField(tiff,37706,&length,&tietz) == 1)
+    {
+      (void) FormatLocaleString(message,MagickPathExtent,"%lu",tietz[0]);
+      (void) SetImageProperty(image,"tiff:tietz_offset",message,exception);
+    }
 }
 
 static void TIFFGetEXIFProperties(TIFF *tiff,Image *image,
@@ -1240,7 +1244,8 @@ RestoreMSCWarning
       }
       case PHOTOMETRIC_LOGL:
       {
-        (void) SetImageProperty(image,"tiff:photometric","CIE Log2(L)",exception);
+        (void) SetImageProperty(image,"tiff:photometric","CIE Log2(L)",
+          exception);
         break;
       }
       case PHOTOMETRIC_LOGLUV:
@@ -1398,8 +1403,8 @@ RestoreMSCWarning
              &horizontal,&vertical);
            if (tiff_status == 1)
              {
-               (void) FormatLocaleString(sampling_factor,MagickPathExtent,"%dx%d",
-                 horizontal,vertical);
+               (void) FormatLocaleString(sampling_factor,MagickPathExtent,
+                 "%dx%d",horizontal,vertical);
                (void) SetImageProperty(image,"jpeg:sampling-factor",
                  sampling_factor,exception);
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),