]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 8 Feb 2012 01:01:05 +0000 (01:01 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 8 Feb 2012 01:01:05 +0000 (01:01 +0000)
coders/gif.c
coders/jpeg.c
coders/png.c

index cf640a8334d6a727786a36515399e4728dc813dc..3a1fd7753746dcdaa86755c535b925cbf46af1fc 100644 (file)
@@ -1220,6 +1220,7 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)
       Read image attributes.
     */
     image->storage_class=PseudoClass;
+    image->colorspace=sRGBColorspace;
     image->compression=LZWCompression;
     page.x=(ssize_t) ReadBlobLSBShort(image);
     page.y=(ssize_t) ReadBlobLSBShort(image);
@@ -1227,10 +1228,9 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)
     image->rows=ReadBlobLSBShort(image);
     image->depth=8;
     flag=(unsigned char) ReadBlobByte(image);
-    image->interlace=BitSet((int) flag,0x40) != 0 ? GIFInterlace :
-      NoInterlace;
-    image->colors=BitSet((int) flag,0x80) == 0 ? global_colors :
-      one << ((size_t) (flag & 0x07)+1);
+    image->interlace=BitSet((int) flag,0x40) != 0 ? GIFInterlace : NoInterlace;
+    image->colors=BitSet((int) flag,0x80) == 0 ? global_colors : one <<
+      ((size_t) (flag & 0x07)+1);
     if (opacity >= (ssize_t) image->colors)
       opacity=(-1);
     image->page.width=page.width;
@@ -1288,8 +1288,8 @@ static Image *ReadGIFImage(const ImageInfo *image_info,ExceptionInfo *exception)
         /*
           Read local colormap.
         */
-        colormap=(unsigned char *) AcquireQuantumMemory(image->colors,
-          3*sizeof(*colormap));
+        colormap=(unsigned char *) AcquireQuantumMemory(image->colors,3*
+          sizeof(*colormap));
         if (colormap == (unsigned char *) NULL)
           {
             global_colormap=(unsigned char *) RelinquishMagickMemory(
index e3d4b4b009336acf7f8e886b4d1c4c83da196023..b49a4e4e4b0770eb2734ba4b60fc2a2d35134225 100644 (file)
@@ -1052,6 +1052,8 @@ static Image *ReadJPEGImage(const ImageInfo *image_info,
   else
     if (jpeg_info.out_color_space == JCS_CMYK)
       image->colorspace=CMYKColorspace;
+    else
+      image->colorspace=sRGBColorspace;
   /*
     Set image resolution.
   */
index 1882714ad8e0b235a5e42da176c755f2ab5b98a2..e682036f3fa4a297850b131c02b6b5d078c41de4 100644 (file)
@@ -2346,6 +2346,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
 
     if (png_get_sRGB(ping,ping_info,&intent))
       {
+        image->colorspace=sRGBColorspace;
         image->rendering_intent=Magick_RenderingIntent_from_PNG_RenderingIntent
           (intent);
 
@@ -3573,11 +3574,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
 #if defined(PNG_sRGB_SUPPORTED)
      if (png_get_valid(ping,ping_info,PNG_INFO_sRGB))
        {
+         image->colorspace=sRGBColorspace;
          (void) FormatLocaleString(msg,MaxTextExtent,
-            "intent=%d (See Rendering intent)",
-            (int) intent);
+            "intent=%d (See Rendering intent)", (int) intent);
          (void) SetImageProperty(image,"png:sRGB                 ",msg,
-                exception);
+           exception);
        }
 #endif