From 454d4e77753f3dd14ab82018d77121c284bb2e74 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 7 Apr 2021 11:22:15 +0200 Subject: [PATCH] src/img2pdf_test.py: distinguish between depth and baseDepth for tiff_rgb12 and tiff_rgb13 --- src/img2pdf_test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/img2pdf_test.py b/src/img2pdf_test.py index ce54752..2a83976 100755 --- a/src/img2pdf_test.py +++ b/src/img2pdf_test.py @@ -2587,7 +2587,11 @@ def tiff_rgb12_img(tmp_path_factory, tmp_normal16_png): assert identify[0]["image"].get(endian) in ["Undefined", "LSB",], str( identify ) # FIXME: should be LSB - assert identify[0]["image"].get("depth") == 12, str(identify) + if identify[0].get("version", "0") < "1.0": + assert identify[0]["image"].get("depth") == 12, str(identify) + else: + assert identify[0]["image"].get("depth") == 16, str(identify) + assert identify[0]["image"].get("baseDepth") == 12, str(identify) assert identify[0]["image"].get("pageGeometry") == { "width": 60, "height": 60, @@ -2639,7 +2643,11 @@ def tiff_rgb14_img(tmp_path_factory, tmp_normal16_png): assert identify[0]["image"].get(endian) in ["Undefined", "LSB",], str( identify ) # FIXME: should be LSB - assert identify[0]["image"].get("depth") == 14, str(identify) + if identify[0].get("version", "0") < "1.0": + assert identify[0]["image"].get("depth") == 14, str(identify) + else: + assert identify[0]["image"].get("depth") == 16, str(identify) + assert identify[0]["image"].get("baseDepth") == 14, str(identify) assert identify[0]["image"].get("pageGeometry") == { "width": 60, "height": 60,