From c6e35d1ec2abaab2bbbb133f5d17aa1a4c2eca4d Mon Sep 17 00:00:00 2001 From: Hubbitus Date: Sat, 21 Nov 2015 20:15:18 +0300 Subject: [PATCH] Add patch fix-XPM.patch (upstream fix for #1217178). --- ImageMagick.spec | 10 +++++++++- fix-XPM.patch | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 fix-XPM.patch diff --git a/ImageMagick.spec b/ImageMagick.spec index 7835bf9..0437e21 100644 --- a/ImageMagick.spec +++ b/ImageMagick.spec @@ -3,7 +3,7 @@ Name: ImageMagick Version: %{VER}.%{Patchlevel} -Release: 0.beta.3%{?dist}.2 +Release: 0.beta.4%{?dist} Summary: An X application for displaying and manipulating images Group: Applications/Multimedia License: ImageMagick @@ -23,6 +23,8 @@ BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel BuildRequires: jbigkit-devel BuildRequires: openjpeg2-devel >= 2.1.0 +Patch0: fix-XPM.patch + %description ImageMagick is an image display and manipulation tool for the X Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF, @@ -134,6 +136,9 @@ however. %prep %setup -q -n %{name}-%{VER}-%{Patchlevel} + +%patch0 -p0 -b .xpm-fix + sed -i 's/libltdl.la/libltdl.so/g' configure iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp touch -r README.txt README.txt.tmp @@ -324,6 +329,9 @@ rm -rf %{buildroot} %doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt %changelog +* Sat Nov 21 2015 Pavel Alexeev - 6.9.1.3-0.beta.4 +- Add patch fix-XPM.patch (upstream fix for #1217178). + * Tue Jun 16 2015 Fedora Release Engineering - 6.9.1.3-0.beta.3.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild diff --git a/fix-XPM.patch b/fix-XPM.patch new file mode 100644 index 0000000..b516b68 --- /dev/null +++ b/fix-XPM.patch @@ -0,0 +1,20 @@ +--- magick/colormap.c.orig 2014-12-25 21:05:34.000000000 +0300 ++++ magick/colormap.c 2015-11-21 16:06:49.632335362 +0300 +@@ -112,7 +112,7 @@ + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); +- image->colors=MagickMax(colors,2); ++ image->colors=MagickMax(colors,1); + if (image->colormap == (PixelPacket *) NULL) + image->colormap=(PixelPacket *) AcquireQuantumMemory(image->colors, + sizeof(*image->colormap)); +@@ -131,7 +131,7 @@ + size_t + pixel; + +- pixel=(size_t) (i*(QuantumRange/(image->colors-1))); ++ pixel=(size_t) (i*(QuantumRange/MagickMax(colors-1,1))); + image->colormap[i].red=(Quantum) pixel; + image->colormap[i].green=(Quantum) pixel; + image->colormap[i].blue=(Quantum) pixel;