]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=2944
authorCristy <urban-warrior@imagemagick.org>
Tue, 12 Apr 2016 23:43:58 +0000 (19:43 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 12 Apr 2016 23:43:58 +0000 (19:43 -0400)
MagickCore/color.c

index 717f7c5485c18db9e56a8ebd37c8f2856482e472..3090bb52f515202b882dd469ec2202fce62560d8 100644 (file)
@@ -1158,6 +1158,13 @@ MagickExport void ConcatenateColorComponent(const PixelInfo *pixel,
   }
   if (compliance == NoCompliance)
     {
+      if (pixel->colorspace == LabColorspace)
+        {
+          (void) FormatLocaleString(text,MagickPathExtent,"%.*g",
+            GetMagickPrecision(),(double) color);
+          (void) ConcatenateMagickString(tuple,text,MagickPathExtent);
+          return;
+        }
       (void) FormatLocaleString(text,MagickPathExtent,"%.*g",
         GetMagickPrecision(),(double) ClampToQuantum(color));
       (void) ConcatenateMagickString(tuple,text,MagickPathExtent);
@@ -1210,7 +1217,14 @@ MagickExport void ConcatenateColorComponent(const PixelInfo *pixel,
       (void) ConcatenateMagickString(tuple,text,MagickPathExtent);
       return;
     }
-  if ((pixel->colorspace == LabColorspace) || (pixel->depth > 8))
+  if (pixel->colorspace == LabColorspace)
+    {
+      (void) FormatLocaleString(text,MagickPathExtent,"%.*g%%",
+        GetMagickPrecision(),100.0*QuantumScale*color);
+      (void) ConcatenateMagickString(tuple,text,MagickPathExtent);
+      return;
+    }
+  if (pixel->depth > 8)
     {
       (void) FormatLocaleString(text,MagickPathExtent,"%.*g%%",
         GetMagickPrecision(),(double) ClampToQuantum(100.0*QuantumScale*color));