From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/kxstitch/, media-gfx/kxstitch/files/
Date: Wed, 15 Nov 2017 23:28:03 +0000 (UTC) [thread overview]
Message-ID: <1510788417.89d6a8e483252a7839cff515f8eed7e32c5aabe8.asturm@gentoo> (raw)
commit: 89d6a8e483252a7839cff515f8eed7e32c5aabe8
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 15 22:02:01 2017 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Nov 15 23:26:57 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89d6a8e4
media-gfx/kxstitch: Fix build w/ >=ImageMagick-7
Closes: https://bugs.gentoo.org/636998
Package-Manager: Portage-2.3.14, Repoman-2.3.6
.../files/kxstitch-2.0.0-imagemagick-7.patch | 93 ++++++++++++++++++++++
media-gfx/kxstitch/kxstitch-2.0.0.ebuild | 4 +-
2 files changed, 96 insertions(+), 1 deletion(-)
diff --git a/media-gfx/kxstitch/files/kxstitch-2.0.0-imagemagick-7.patch b/media-gfx/kxstitch/files/kxstitch-2.0.0-imagemagick-7.patch
new file mode 100644
index 00000000000..fe53efba302
--- /dev/null
+++ b/media-gfx/kxstitch/files/kxstitch-2.0.0-imagemagick-7.patch
@@ -0,0 +1,93 @@
+From 295773f44bfda1227d85edf065a8de14dc889159 Mon Sep 17 00:00:00 2001
+From: Steve Allewell <steve.allewell@gmail.com>
+Date: Wed, 25 Oct 2017 20:57:22 +0100
+Subject: Fix for changes to ImageMagick API for importing images
+
+---
+ src/FlossScheme.cpp | 4 ++--
+ src/ImportImageDlg.cpp | 9 ++++++---
+ src/MainWindow.cpp | 10 ++++++----
+ 3 files changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/src/FlossScheme.cpp b/src/FlossScheme.cpp
+index 4c59973..e4cd117 100644
+--- a/src/FlossScheme.cpp
++++ b/src/FlossScheme.cpp
+@@ -38,8 +38,8 @@ Floss *FlossScheme::convert(const QColor &color)
+ Magick::Image image = Magick::Image(1, 1, "RGB", MagickLib::CharPixel, c);
+ #endif
+ image.map(*m_map);
+- const Magick::PixelPacket *pixels = image.getConstPixels(0, 0, 1, 1);
+- const Magick::ColorRGB rgb = Magick::Color(*pixels);
++
++ const Magick::ColorRGB rgb = image.pixelColor(0,0);
+
+ return find(QColor((int)(255*rgb.red()), (int)(255*rgb.green()), (int)(255*rgb.blue())));
+ }
+diff --git a/src/ImportImageDlg.cpp b/src/ImportImageDlg.cpp
+index d12ca34..79e8c38 100644
+--- a/src/ImportImageDlg.cpp
++++ b/src/ImportImageDlg.cpp
+@@ -305,9 +305,12 @@ void ImportImageDlg::renderPixmap()
+ QProgressDialog progress(i18n("Rendering preview"), i18n("Cancel"), 0, pixelCount, this);
+ progress.setWindowModality(Qt::WindowModal);
+
++#if MagickLibVersion < 0x700
+ bool hasTransparency = m_convertedImage.matte();
+- const Magick::PixelPacket *pixels = m_convertedImage.getConstPixels(0, 0, width, height);
+-
++#else
++ bool hasTransparency = m_convertedImage.alpha();
++#endif
++
+ for (int dy = 0 ; dy < height ; dy++) {
+ QApplication::processEvents();
+ progress.setValue(dy * width);
+@@ -317,7 +320,7 @@ void ImportImageDlg::renderPixmap()
+ }
+
+ for (int dx = 0 ; dx < width ; dx++) {
+- Magick::ColorRGB rgb = Magick::Color(*pixels++);
++ Magick::ColorRGB rgb = m_convertedImage.pixelColor(dx, dy);
+
+ if (hasTransparency && (rgb.alpha() == 1)) {
+ //ignore this pixel as it is transparent
+diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
+index 9713293..1d22e63 100644
+--- a/src/MainWindow.cpp
++++ b/src/MainWindow.cpp
+@@ -543,7 +543,11 @@ void MainWindow::convertImage(const QString &source)
+
+ bool useFractionals = importImageDlg->useFractionals();
+
++#if MagickLibVersion < 0x700
+ bool hasTransparency = convertedImage.matte();
++#else
++ bool hasTransparency = convertedImage.alpha();
++#endif
+ bool ignoreColor = importImageDlg->ignoreColor();
+ Magick::Color ignoreColorValue = importImageDlg->ignoreColorValue();
+
+@@ -564,8 +568,6 @@ void MainWindow::convertImage(const QString &source)
+ QProgressDialog progress(i18n("Converting to stitches"), i18n("Cancel"), 0, pixelCount, this);
+ progress.setWindowModality(Qt::WindowModal);
+
+- const Magick::PixelPacket *pixels = convertedImage.getConstPixels(0, 0, imageWidth, imageHeight);
+-
+ for (int dy = 0 ; dy < imageHeight ; dy++) {
+ progress.setValue(dy * imageWidth);
+ QApplication::processEvents();
+@@ -577,8 +579,8 @@ void MainWindow::convertImage(const QString &source)
+ }
+
+ for (int dx = 0 ; dx < imageWidth ; dx++) {
+- Magick::ColorRGB rgb = Magick::Color(*pixels++);
+-
++ Magick::ColorRGB rgb = convertedImage.pixelColor(dx, dy);
++
+ if (hasTransparency && (rgb.alpha() == 1)) {
+ // ignore this pixel as it is transparent
+ } else {
+--
+cgit v0.11.2
+
diff --git a/media-gfx/kxstitch/kxstitch-2.0.0.ebuild b/media-gfx/kxstitch/kxstitch-2.0.0.ebuild
index 32222fe706e..02fe8204fac 100644
--- a/media-gfx/kxstitch/kxstitch-2.0.0.ebuild
+++ b/media-gfx/kxstitch/kxstitch-2.0.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -37,3 +37,5 @@ RDEPEND="
DEPEND="${RDEPEND}
sys-devel/gettext
"
+
+PATCHES=( "${FILESDIR}/${P}-imagemagick-7.patch" )
next reply other threads:[~2017-11-15 23:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 23:28 Andreas Sturmlechner [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-11 17:07 [gentoo-commits] repo/gentoo:master commit in: media-gfx/kxstitch/, media-gfx/kxstitch/files/ Andreas Sturmlechner
2018-08-31 17:58 Andreas Sturmlechner
2019-06-22 14:50 Andreas Sturmlechner
2025-01-13 23:05 Andreas Sturmlechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1510788417.89d6a8e483252a7839cff515f8eed7e32c5aabe8.asturm@gentoo \
--to=asturm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox