diff -Nru imagemagick-6.8.9.9/debian/changelog imagemagick-6.8.9.9/debian/changelog --- imagemagick-6.8.9.9/debian/changelog 2016-03-06 00:53:25.000000000 -0800 +++ imagemagick-6.8.9.9/debian/changelog 2016-03-09 15:55:11.000000000 -0800 @@ -1,3 +1,9 @@ +imagemagick (8:6.8.9.9-7ubuntu3) xenial; urgency=medium + + * Add backport of 54b752c3 to fix color behavior (LP: #1549942). + + -- Nishanth Aravamudan Tue, 08 Mar 2016 09:22:10 -0800 + imagemagick (8:6.8.9.9-7ubuntu2) xenial; urgency=medium * Add backport of a54fe0e8 to fix segmentation faults during diff -Nru imagemagick-6.8.9.9/debian/patches/0077-Backport-54b752c3.patch imagemagick-6.8.9.9/debian/patches/0077-Backport-54b752c3.patch --- imagemagick-6.8.9.9/debian/patches/0077-Backport-54b752c3.patch 1969-12-31 16:00:00.000000000 -0800 +++ imagemagick-6.8.9.9/debian/patches/0077-Backport-54b752c3.patch 2016-03-08 09:21:57.000000000 -0800 @@ -0,0 +1,44 @@ +Description: ImageMagick 6.9.2 has incorrect getColor behavior + A further fix was pushed upstream for the color code to ensure that + color values are rounded correctly to the quantum. +Author: Nishanth Aravamudan +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1549942 +Origin: backport, https://github.com/ImageMagick/ImageMagick/commit/54b752c303f12fa7f39f4990b859403932c11e03#diff-b48c4feab32724d54e6e77845f23f7cc + +--- imagemagick-6.8.9.9.orig/magick/color.c ++++ imagemagick-6.8.9.9/magick/color.c +@@ -1159,7 +1159,7 @@ MagickExport void ConcatenateColorCompon + if (compliance == NoCompliance) + { + (void) FormatLocaleString(component,MaxTextExtent,"%.*g", +- GetMagickPrecision(),color); ++ GetMagickPrecision(),(double) ClampToQuantum(color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } +@@ -1187,7 +1187,7 @@ MagickExport void ConcatenateColorCompon + if (channel == OpacityChannel) + { + (void) FormatLocaleString(component,MaxTextExtent,"%.*g", +- GetMagickPrecision(),(QuantumScale*color)); ++ GetMagickPrecision(),(double) ClampToQuantum(QuantumScale*color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } +@@ -1200,14 +1200,14 @@ MagickExport void ConcatenateColorCompon + (pixel->colorspace == HWBColorspace)) + { + (void) FormatLocaleString(component,MaxTextExtent,"%.*g%%", +- GetMagickPrecision(),(100.0*QuantumScale*color)); ++ GetMagickPrecision(),(double) ClampToQuantum(100.0*QuantumScale*color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + if ((pixel->colorspace == LabColorspace) || (pixel->depth > 8)) + { + (void) FormatLocaleString(component,MaxTextExtent,"%.*g%%", +- GetMagickPrecision(),(100.0*QuantumScale*color)); ++ GetMagickPrecision(),(double) ClampToQuantum(100.0*QuantumScale*color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } diff -Nru imagemagick-6.8.9.9/debian/patches/series imagemagick-6.8.9.9/debian/patches/series --- imagemagick-6.8.9.9/debian/patches/series 2016-03-06 00:53:25.000000000 -0800 +++ imagemagick-6.8.9.9/debian/patches/series 2016-03-08 09:20:29.000000000 -0800 @@ -75,3 +75,4 @@ 0074-Fix-overflow-in-pict-image-parsing.patch 0075-Fix-buffer-overflow-in-icon-parsing-code.patch 0076-Fix-segmentation-fault-with-php-imagick.patch +0077-Backport-54b752c3.patch