[packages/pfstools] - fix building with ImageMagick 7 - rel 7
baggins
baggins at pld-linux.org
Mon Dec 26 23:06:36 CET 2016
commit 67bd2304e516545f2b203f975ac5dd30d2b479b3
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Dec 26 23:06:11 2016 +0100
- fix building with ImageMagick 7
- rel 7
imagemagick7.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
pfstools.spec | 4 +++-
2 files changed, 49 insertions(+), 1 deletion(-)
---
diff --git a/pfstools.spec b/pfstools.spec
index 7944a07..1e4b39d 100644
--- a/pfstools.spec
+++ b/pfstools.spec
@@ -7,13 +7,14 @@ Summary: pfstools for High Dynamic Range Images and Video
Summary(pl.UTF-8): Narzędzia do obrazów i wideo o dużym zakresie luminancji
Name: pfstools
Version: 2.0.4
-Release: 6
+Release: 7
License: LGPL v2.1+
Group: Libraries
Source0: http://downloads.sourceforge.net/pfstools/%{name}-%{version}.tgz
# Source0-md5: f17e2834798cda75d32b2fcd11826d82
Patch0: pfstools-2.0.4-maptype.patch
Patch1: pfstools-2.0.4-octinstall.patch
+Patch2: imagemagick7.patch
URL: http://pfstools.sourceforge.net/
BuildRequires: ImageMagick-c++-devel >= 6.0
BuildRequires: OpenEXR-devel >= 1.0
@@ -95,6 +96,7 @@ Wiązania języka Octave do pfstools.
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
install -d build
diff --git a/imagemagick7.patch b/imagemagick7.patch
new file mode 100644
index 0000000..6010438
--- /dev/null
+++ b/imagemagick7.patch
@@ -0,0 +1,46 @@
+diff -ur pfstools-2.0.4/src/fileformat/pfsinimgmagick.cpp pfstools-2.0.4-im7/src/fileformat/pfsinimgmagick.cpp
+--- pfstools-2.0.4/src/fileformat/pfsinimgmagick.cpp 2015-07-15 11:58:19.000000000 +0200
++++ pfstools-2.0.4-im7/src/fileformat/pfsinimgmagick.cpp 2016-12-26 23:03:33.929300971 +0100
+@@ -35,6 +35,7 @@
+
+ #define PROG_NAME "pfsinimgmagick"
+
++using namespace Magick;
+
+ class QuietException
+ {
+@@ -112,7 +113,7 @@
+ Magick::Image imImage( ff.fileName );
+
+ VERBOSE_STR << "input image gamma: " << imImage.gamma() << std::endl;
+- bool hasAlpha = imImage.matte();
++ bool hasAlpha = imImage.alpha();
+ if( hasAlpha )
+ VERBOSE_STR << "alpha channel found" << std::endl;
+
+@@ -127,18 +128,19 @@
+
+ // Copy line by line to pfs::Frame
+ int pixInd = 0;
+- const float maxValue = (float)(1<<QuantumDepth) - 1;
++ const float maxValue = (float)QuantumRange;
+ for( int r = 0; r < imImage.rows(); r++ ) {
+- const Magick::PixelPacket *pixels =
++ const Magick::Quantum *pixels =
+ imImage.getConstPixels( 0, r, imImage.columns(), 1 );
+
+ for( int c = 0; c < imImage.columns(); c++ ) {
+- (*X)(pixInd) = (float)pixels[c].red / maxValue;
+- (*Y)(pixInd) = (float)pixels[c].green / maxValue;
+- (*Z)(pixInd) = (float)pixels[c].blue / maxValue;
++ (*X)(pixInd) = (float)MagickCore::GetPixelRed(imImage.image(), pixels) / maxValue;
++ (*Y)(pixInd) = (float)MagickCore::GetPixelGreen(imImage.image(), pixels) / maxValue;
++ (*Z)(pixInd) = (float)MagickCore::GetPixelBlue(imImage.image(), pixels) / maxValue;
+ if( alpha != NULL )
+- (*alpha)(pixInd) = (float)pixels[c].opacity / maxValue;
++ (*alpha)(pixInd) = (float)MagickCore::GetPixelAlpha(imImage.image(), pixels) / maxValue;
+ pixInd++;
++ pixels += GetPixelChannels(imImage.image());
+ }
+ }
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/pfstools.git/commitdiff/67bd2304e516545f2b203f975ac5dd30d2b479b3
More information about the pld-cvs-commit
mailing list