]> granicus.if.org Git - imagemagick/blobdiff - coders/ipl.c
Fix for ignoring tiff tags.
[imagemagick] / coders / ipl.c
index d734af7960501a6d97e9af4297712932e514f000..58ca55501b13777b52e545cd84e17d2676896a72 100644 (file)
@@ -19,7 +19,7 @@
 %                                  2008.05.07                                 %
 %                                     v 0.9                                   %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -84,7 +84,8 @@ typedef struct _IPLInfo
 static MagickBooleanType
   WriteIPLImage(const ImageInfo *,Image *,ExceptionInfo *);
 
-void increase (void *pixel, int byteType){
+/*
+static void increase (void *pixel, int byteType){
   switch(byteType){
     case 0:(*((unsigned char *) pixel))++; break;
     case 1:(*((signed int *) pixel))++; break;
@@ -93,6 +94,7 @@ void increase (void *pixel, int byteType){
     default:(*((unsigned int *) pixel))++; break;
   }  
 }
+*/
 
 /*
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -161,7 +163,7 @@ static MagickBooleanType IsIPL(const unsigned char *magick,const size_t length)
  %
  */
 
-void SetHeaderFromIPL(Image *image, IPLInfo *ipl){
+static void SetHeaderFromIPL(Image *image, IPLInfo *ipl){
   image->columns = ipl->width;
   image->rows = ipl->height;
   image->depth = ipl->depth;
@@ -246,7 +248,7 @@ static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if((ipl_info.width == 0UL) || (ipl_info.height == 0UL))
     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   ipl_info.colors=ReadBlobLong(image); 
-  if(ipl_info.colors == 3){ image->colorspace=RGBColorspace;}
+  if(ipl_info.colors == 3){ SetImageColorspace(image,sRGBColorspace,exception);}
   else { image->colorspace = GRAYColorspace; }
   ipl_info.z=ReadBlobLong(image); 
   ipl_info.time=ReadBlobLong(image); 
@@ -575,11 +577,8 @@ static MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image,
   ipl_info.time = 1;
   ipl_info.width = (unsigned int) image->columns;
   ipl_info.height = (unsigned int) image->rows;
-  
-  if (IssRGBColorspace(image->colorspace) == MagickFalse)
-    (void) TransformImageColorspace(image,sRGBColorspace,exception);
-  
-  if(IssRGBColorspace(image->colorspace) == MagickTrue) { ipl_info.colors = 3; }
+  (void) TransformImageColorspace(image,sRGBColorspace,exception);
+  if(IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) { ipl_info.colors = 3; }
   else{ ipl_info.colors = 1; }
   
   ipl_info.size = (unsigned int) (28 +