From: Cristy Date: Tue, 12 Apr 2016 23:43:58 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=2944 X-Git-Tag: 7.0.1-0~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3da9d107ead340372f99cecbe8bbc67fba0f8377;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=2944 --- diff --git a/MagickCore/color.c b/MagickCore/color.c index 717f7c548..3090bb52f 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -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));