From 473903b70e1b269a6110242a9c098a10c18554e2 Mon Sep 17 00:00:00 2001
From: jvoisin <julien.voisin@dustri.org>
Date: Thu, 3 Apr 2025 15:58:27 +0200
Subject: [PATCH] Fix HEIC parsing with the latest exiftool

---
 tests/test_libmat2.py | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py
index 0f7803a..2147ee8 100644
--- a/tests/test_libmat2.py
+++ b/tests/test_libmat2.py
@@ -536,7 +536,40 @@ class TestCleaning(unittest.TestCase):
             'parser': images.HEICParser,
             'meta': {},
             'expected_meta': {
+                'BlueMatrixColumn': '0.14305 0.06061 0.71393',
+                'BlueTRC': '(Binary data 32 bytes, use -b option to extract)',
+                'CMMFlags': 'Not Embedded, Independent',
+                'ChromaticAdaptation': '1.04788 0.02292 -0.05022 0.02959 0.99048 -0.01707 -0.00925 0.01508 0.75168',
+                'ChromaticityChannel1': '0.64 0.33002',
+                'ChromaticityChannel2': '0.3 0.60001',
+                'ChromaticityChannel3': '0.15001 0.06',
+                'ChromaticityChannels': 3,
+                'ChromaticityColorant': 'Unknown',
+                'ColorSpaceData': 'RGB ',
+                'ConnectionSpaceIlluminant': '0.9642 1 0.82491',
+                'DeviceAttributes': 'Reflective, Glossy, Positive, Color',
+                'DeviceManufacturer': '',
+                'DeviceMfgDesc': 'GIMP',
+                'DeviceModel': '',
+                'DeviceModelDesc': 'sRGB',
                 'ExifByteOrder': 'Big-endian (Motorola, MM)',
+                'GreenMatrixColumn': '0.38512 0.7169 0.09706',
+                'GreenTRC': '(Binary data 32 bytes, use -b option to extract)',
+                'MediaWhitePoint': '0.9642 1 0.82491',
+                'PrimaryPlatform': 'Apple Computer Inc.',
+                'ProfileCMMType': 'Little CMS',
+                'ProfileClass': 'Display Device Profile',
+                'ProfileConnectionSpace': 'XYZ ',
+                'ProfileCopyright': 'Public Domain',
+                'ProfileCreator': 'Little CMS',
+                'ProfileDateTime': '2022:05:15 16:29:22',
+                'ProfileDescription': 'GIMP built-in sRGB',
+                'ProfileFileSignature': 'acsp',
+                'ProfileID': 0,
+                'ProfileVersion': '4.3.0',
+                'RedMatrixColumn': '0.43604 0.22249 0.01392',
+                'RedTRC': '(Binary data 32 bytes, use -b option to extract)',
+                'RenderingIntent': 'Perceptual',
                 'Warning': 'Bad IFD0 directory',
             },
         }
@@ -573,13 +606,13 @@ class TestCleaning(unittest.TestCase):
                 meta = p2.get_meta()
                 if meta:
                     for k, v in p2.get_meta().items():
-                        self.assertIn(k, case['expected_meta'], '"%s" is not in "%s" (%s)' % (k, case['expected_meta'], case['name']))
+                        self.assertIn(k, case['expected_meta'], '"%s" is not in "%s" (%s), with all of them being %s' % (k, case['expected_meta'], case['name'], p2.get_meta().items()))
                         if str(case['expected_meta'][k]) in str(v):
                             continue
                         if 'extra_expected_meta' in case and k in case['extra_expected_meta']:
                             if str(case['extra_expected_meta'][k]) in str(v):
                                 continue
-                        self.assertTrue(False, "got a different value (%s) than excepted (%s) for %s" % (str(v), meta, k))
+                        self.assertTrue(False, "got a different value (%s) than excepted (%s) for %s, with all of them being %s" % (str(v), meta, k, p2.get_meta().items()))
                 self.assertTrue(p2.remove_all())
 
                 os.remove(target)