From: cristy Date: Wed, 9 Nov 2011 19:45:06 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6664 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5d85504800b92e738dd75d400910a53d7d47cca;p=imagemagick --- diff --git a/coders/tiff.c b/coders/tiff.c index 4d3e96141..9d91af4c3 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -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); } @@ -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); }