]> git.pld-linux.org Git - packages/pfstools.git/commitdiff
- fix building with ImageMagick 7 auto/th/pfstools-2.0.4-7
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 26 Dec 2016 22:06:11 +0000 (23:06 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Mon, 26 Dec 2016 22:06:11 +0000 (23:06 +0100)
- rel 7

imagemagick7.patch [new file with mode: 0644]
pfstools.spec

diff --git a/imagemagick7.patch b/imagemagick7.patch
new file mode 100644 (file)
index 0000000..6010438
--- /dev/null
@@ -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());
+       } 
+     }    
index 7944a0784b796d52de043fc12b08c59e49d6c071..1e4b39d21d8e1b21a5997dd0e38311c2fe6fe48a 100644 (file)
@@ -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
This page took 0.092463 seconds and 4 git commands to generate.