src/img2pdf_test.py: distinguish between depth and baseDepth for tiff_rgb12 and tiff_rgb13

This commit is contained in:
Johannes Schauer Marin Rodrigues 2021-04-07 11:22:15 +02:00
parent cb2243fd10
commit 454d4e7775
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -2587,7 +2587,11 @@ def tiff_rgb12_img(tmp_path_factory, tmp_normal16_png):
assert identify[0]["image"].get(endian) in ["Undefined", "LSB",], str( assert identify[0]["image"].get(endian) in ["Undefined", "LSB",], str(
identify identify
) # FIXME: should be LSB ) # 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") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
"height": 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( assert identify[0]["image"].get(endian) in ["Undefined", "LSB",], str(
identify identify
) # FIXME: should be LSB ) # 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") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
"height": 60, "height": 60,