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

index 10ca5a2a9d8047e3372c2a60d95e4938244dfd5a..ea5a3a9303a12aab34660d86e4b5abe045659bc7 100644 (file)
@@ -1061,7 +1061,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
   (void) FormatLocaleFile(file,"  Tainted: %s\n",CommandOptionToMnemonic(
     MagickBooleanOptions,(ssize_t) image->taint));
   (void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
-  (void) FormatLocaleFile(file,"  Filesize: %sB\n",format);
+  (void) FormatLocaleFile(file,"  Filesize: %s\n",format);
   (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
      MagickFalse,format);
   (void) FormatLocaleFile(file,"  Number pixels: %s\n",format);
index 9d91af4c364a88f348f19e769c34d6100559a0c7..79ddc535491ef05f1160c4ad51f29c740f6c390d 100644 (file)
@@ -507,6 +507,11 @@ static void TIFFErrors(const char *module,const char *format,va_list error)
       "`%s'",module);
 }
 
+static toff_t TIFFGetBlobSize(thandle_t image)
+{
+  return((toff_t) GetBlobSize((Image *) image));
+}
+
 static void TIFFGetProfiles(TIFF *tiff,Image *image,ExceptionInfo *exception)
 {
   uint32
@@ -734,10 +739,24 @@ static toff_t TIFFSeekBlob(thandle_t image,toff_t offset,int whence)
   return((toff_t) SeekBlob((Image *) image,(MagickOffsetType) offset,whence));
 }
 
-static toff_t TIFFGetBlobSize(thandle_t image)
+#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER)
+static TIFFExtendProc
+  tiff_extensions = (TIFFExtendProc) NULL;
+
+static void TIFFTagExtender(TIFF *tiff)
 {
-  return((toff_t) GetBlobSize((Image *) image));
+  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
 
 static void TIFFUnmapBlob(thandle_t image,tdata_t base,toff_t size)
 {
@@ -876,6 +895,10 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
       image_info->filename);
   assert(exception != (ExceptionInfo *) NULL);
   assert(exception->signature == MagickSignature);
+#if defined(MAGICKCORE_HAVE_TIFFMERGEFIELDINFO) && defined(MAGICKCORE_HAVE_TIFFSETTAGEXTENDER)
+  if (tiff_extensions == (TIFFExtendProc) NULL)
+    tiff_extensions=TIFFSetTagExtender(TIFFTagExtender);
+#endif
   image=AcquireImage(image_info,exception);
   status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
   if (status == MagickFalse)
@@ -1749,26 +1772,6 @@ 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"
@@ -1875,10 +1878,6 @@ 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