]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 9 Nov 2011 19:45:06 +0000 (19:45 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 9 Nov 2011 19:45:06 +0000 (19:45 +0000)
coders/tiff.c

index 4d3e96141e9cc0276c22fa9cca3522cd061a0ea4..9d91af4c364a88f348f19e769c34d6100559a0c7 100644 (file)
@@ -1749,6 +1749,26 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
 %      size_t RegisterTIFFImage(void)
 %
 */
+
+#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER)
+static TIFFExtendProc
+  tiff_extensions = (TIFFExtendProc) NULL;
+
+static void TIFFTagExtender(TIFF *tiff)
+{
+  static const TIFFFieldInfo
+    TIFFExtensions[] =
+    {
+      { 37724, -3, -3, TIFF_UNDEFINED, FIELD_CUSTOM, 1, 1, "PhotoshopLayerData" }
+    };
+
+  TIFFMergeFieldInfo(tiff,TIFFExtensions,sizeof(TIFFExtensions)/
+    sizeof(*TIFFExtensions));
+  if (tiff_extensions != (TIFFExtendProc) NULL)
+    (*tiff_extensions)(tiff);
+}
+#endif
+
 ModuleExport size_t RegisterTIFFImage(void)
 {
 #define TIFFDescription  "Tagged Image File Format"
@@ -1855,6 +1875,10 @@ ModuleExport size_t RegisterTIFFImage(void)
     entry->version=ConstantString(version);
   entry->module=ConstantString("TIFF");
   (void) RegisterMagickInfo(entry);
+#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER)
+  if (tiff_extensions == (TIFFExtendProc) NULL)
+    tiff_extensions=TIFFSetTagExtender(TIFFTagExtender);
+#endif
   return(MagickImageCoderSignature);
 }
 \f
@@ -2357,7 +2381,7 @@ static void TIFFSetProfiles(TIFF *tiff,Image *image)
         GetStringInfoLength(profile),GetStringInfoDatum(profile));
 #endif
     if (LocaleCompare(name,"tiff:37724") == 0)
-      (void) TIFFSetField(tiff,37724,(uint32)GetStringInfoLength(profile),
+      (void) TIFFSetField(tiff,37724,(uint32) GetStringInfoLength(profile),
         GetStringInfoDatum(profile));
     name=GetNextImageProfile(image);
   }