[diffoscope] 03/03: comparators.image: No need to use niche icotool if we are going to use imagemagick elsewhere.

Chris Lamb chris at chris-lamb.co.uk
Sun Jan 15 02:26:36 CET 2017


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 1131e07aad99b78c861f75f36e9643b27b4b1b76
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Jan 15 11:30:51 2017 +1100

    comparators.image: No need to use niche icotool if we are going to use imagemagick elsewhere.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/image.py     | 6 +++---
 diffoscope/exc.py                   | 5 +++--
 tests/comparators/test_ico_image.py | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/diffoscope/comparators/image.py b/diffoscope/comparators/image.py
index 9ad50d5..5192481 100644
--- a/diffoscope/comparators/image.py
+++ b/diffoscope/comparators/image.py
@@ -110,10 +110,10 @@ class ICOImageFile(File):
         ]
 
     @staticmethod
-    @tool_required('icotool')
+    @tool_required('convert')
     def convert(file):
-        result = get_named_temporary_file().name
+        result = get_named_temporary_file(suffix='.png').name
 
-        subprocess.check_call(('icotool', '-x', '-o', result, file.path))
+        subprocess.check_call(('convert', file.path, result))
 
         return result
diff --git a/diffoscope/exc.py b/diffoscope/exc.py
index b116ac8..5a8e483 100644
--- a/diffoscope/exc.py
+++ b/diffoscope/exc.py
@@ -131,8 +131,9 @@ class RequiredToolNotFound(Exception):
             'arch': 'gettext',
             'FreeBSD': 'gettext-tools',
         },
-        'icotool': {
-            'debian': 'icoutils',
+        'convert': {
+            'debian': 'imagemagick',
+            'arch': 'imagemagick',
         },
         'nm': {
             'debian': 'binutils-multiarch',
diff --git a/tests/comparators/test_ico_image.py b/tests/comparators/test_ico_image.py
index a8decdd..3cebd78 100644
--- a/tests/comparators/test_ico_image.py
+++ b/tests/comparators/test_ico_image.py
@@ -40,7 +40,7 @@ def test_no_differences(image1):
 def differences(image1, image2):
     return image1.compare(image2).details
 
- at skip_unless_tools_exist('img2txt', 'icotool')
+ at skip_unless_tools_exist('img2txt', 'convert')
 def test_diff(differences):
     expected_diff = open(data('ico_image_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list