]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 16 Jan 2014 13:35:05 +0000 (13:35 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 16 Jan 2014 13:35:05 +0000 (13:35 +0000)
coders/jpeg.c

index fdb04e22b6dcda74c33d2ac3df534171df400854..d9b502d27436d59b1aa76499842e28381421cdf9 100644 (file)
@@ -2154,6 +2154,8 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
     }
     case GRAYColorspace:
     {
+      if (image_info->type == TrueColorType)
+        break;
       jpeg_info.input_components=1;
       jpeg_info.in_color_space=JCS_GRAYSCALE;
       break;
@@ -2162,6 +2164,13 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
     {
       if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
         (void) TransformImageColorspace(image,sRGBColorspace,exception);
+      if (image_info->type == TrueColorType)
+        break;
+      if (IsGrayImage(image,&image->exception) != MagickFalse)
+        {
+          jpeg_info.input_components=1;
+          jpeg_info.in_color_space=JCS_GRAYSCALE;
+        }
       break;
     }
   }