1
0
Fork 0
forked from josch/img2pdf

src/img2pdf_test.py: drop check for endianness for tests where it does not matter

IM7 defaults to big-endian on architectures other than x86 even if they
are little endian: https://github.com/ImageMagick/ImageMagick/issues/6300

Closes: #152
This commit is contained in:
Johannes Schauer Marin Rodrigues 2023-07-17 05:35:48 +02:00
parent 29921eeabd
commit 1e8557cef1
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -24,8 +24,6 @@ import xml.etree.ElementTree as ET
img2pdfprog = os.getenv("img2pdfprog", default="src/img2pdf.py") img2pdfprog = os.getenv("img2pdfprog", default="src/img2pdf.py")
BYTEORDER = "LSB" if sys.byteorder == "little" else "MSB"
ICC_PROFILE = None ICC_PROFILE = None
ICC_PROFILE_PATHS = ( ICC_PROFILE_PATHS = (
# Debian # Debian
@ -2361,13 +2359,6 @@ def tiff_float_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("baseDepth") == 32, str(identify) assert identify[0]["image"].get("baseDepth") == 32, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
@ -2383,10 +2374,6 @@ def tiff_float_img(tmp_path_factory, tmp_normal_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2426,13 +2413,6 @@ def tiff_cmyk8_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "CMYK", str(identify) assert identify[0]["image"].get("colorspace") == "CMYK", str(identify)
assert identify[0]["image"].get("type") == "ColorSeparation", str(identify) assert identify[0]["image"].get("type") == "ColorSeparation", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2443,10 +2423,6 @@ def tiff_cmyk8_img(tmp_path_factory, tmp_normal_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "separated" == "separated"
@ -2489,13 +2465,6 @@ def tiff_cmyk16_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "CMYK", str(identify) assert identify[0]["image"].get("colorspace") == "CMYK", str(identify)
assert identify[0]["image"].get("type") == "ColorSeparation", str(identify) assert identify[0]["image"].get("type") == "ColorSeparation", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 16, str(identify) assert identify[0]["image"].get("depth") == 16, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2506,10 +2475,6 @@ def tiff_cmyk16_img(tmp_path_factory, tmp_normal_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "separated" == "separated"
@ -2542,13 +2507,6 @@ def tiff_rgb8_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2559,10 +2517,6 @@ def tiff_rgb8_img(tmp_path_factory, tmp_normal_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2602,13 +2556,6 @@ def tiff_rgb12_img(tmp_path_factory, tmp_normal16_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("baseDepth") == 12, 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,
@ -2619,10 +2566,6 @@ def tiff_rgb12_img(tmp_path_factory, tmp_normal16_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2662,13 +2605,6 @@ def tiff_rgb14_img(tmp_path_factory, tmp_normal16_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("baseDepth") == 14, 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,
@ -2679,10 +2615,6 @@ def tiff_rgb14_img(tmp_path_factory, tmp_normal16_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2722,13 +2654,6 @@ def tiff_rgb16_img(tmp_path_factory, tmp_normal16_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 16, str(identify) assert identify[0]["image"].get("depth") == 16, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2739,10 +2664,6 @@ def tiff_rgb16_img(tmp_path_factory, tmp_normal16_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2783,13 +2704,6 @@ def tiff_rgba8_img(tmp_path_factory, tmp_alpha_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColorAlpha", str(identify) assert identify[0]["image"].get("type") == "TrueColorAlpha", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2800,10 +2714,6 @@ def tiff_rgba8_img(tmp_path_factory, tmp_alpha_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unassociated" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unassociated"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2844,13 +2754,6 @@ def tiff_rgba16_img(tmp_path_factory, tmp_alpha_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColorAlpha", str(identify) assert identify[0]["image"].get("type") == "TrueColorAlpha", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 16, str(identify) assert identify[0]["image"].get("depth") == 16, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2861,10 +2764,6 @@ def tiff_rgba16_img(tmp_path_factory, tmp_alpha_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unassociated" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unassociated"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -2904,13 +2803,6 @@ def tiff_gray1_img(tmp_path_factory, tmp_gray1_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("type") == "Bilevel", str(identify) assert identify[0]["image"].get("type") == "Bilevel", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 1, str(identify) assert identify[0]["image"].get("depth") == 1, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2921,10 +2813,6 @@ def tiff_gray1_img(tmp_path_factory, tmp_gray1_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "min-is-black" == "min-is-black"
@ -2965,13 +2853,6 @@ def tiff_gray2_img(tmp_path_factory, tmp_gray2_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("type") == "Grayscale", str(identify) assert identify[0]["image"].get("type") == "Grayscale", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 2, str(identify) assert identify[0]["image"].get("depth") == 2, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -2982,10 +2863,6 @@ def tiff_gray2_img(tmp_path_factory, tmp_gray2_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "min-is-black" == "min-is-black"
@ -3026,13 +2903,6 @@ def tiff_gray4_img(tmp_path_factory, tmp_gray4_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("type") == "Grayscale", str(identify) assert identify[0]["image"].get("type") == "Grayscale", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 4, str(identify) assert identify[0]["image"].get("depth") == 4, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3043,10 +2913,6 @@ def tiff_gray4_img(tmp_path_factory, tmp_gray4_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "min-is-black" == "min-is-black"
@ -3087,13 +2953,6 @@ def tiff_gray8_img(tmp_path_factory, tmp_gray8_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("type") == "Grayscale", str(identify) assert identify[0]["image"].get("type") == "Grayscale", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3104,10 +2963,6 @@ def tiff_gray8_img(tmp_path_factory, tmp_gray8_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "min-is-black" == "min-is-black"
@ -3148,13 +3003,6 @@ def tiff_gray16_img(tmp_path_factory, tmp_gray16_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("type") == "Grayscale", str(identify) assert identify[0]["image"].get("type") == "Grayscale", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 16, str(identify) assert identify[0]["image"].get("depth") == 16, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3165,10 +3013,6 @@ def tiff_gray16_img(tmp_path_factory, tmp_gray16_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") identify[0]["image"].get("properties", {}).get("tiff:photometric")
== "min-is-black" == "min-is-black"
@ -3211,13 +3055,6 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3228,10 +3065,6 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -3255,13 +3088,6 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3272,10 +3098,6 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "RGB"
), str(identify) ), str(identify)
@ -3308,13 +3130,6 @@ def tiff_palette1_img(tmp_path_factory, tmp_palette1_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "Palette", str(identify) assert identify[0]["image"].get("type") == "Palette", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("baseDepth") == 1, str(identify) assert identify[0]["image"].get("baseDepth") == 1, str(identify)
assert identify[0]["image"].get("colormapEntries") == 2, str(identify) assert identify[0]["image"].get("colormapEntries") == 2, str(identify)
@ -3327,10 +3142,6 @@ def tiff_palette1_img(tmp_path_factory, tmp_palette1_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette"
), str(identify) ), str(identify)
@ -3362,13 +3173,6 @@ def tiff_palette2_img(tmp_path_factory, tmp_palette2_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "Palette", str(identify) assert identify[0]["image"].get("type") == "Palette", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("baseDepth") == 2, str(identify) assert identify[0]["image"].get("baseDepth") == 2, str(identify)
assert identify[0]["image"].get("colormapEntries") == 4, str(identify) assert identify[0]["image"].get("colormapEntries") == 4, str(identify)
@ -3381,10 +3185,6 @@ def tiff_palette2_img(tmp_path_factory, tmp_palette2_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette"
), str(identify) ), str(identify)
@ -3416,13 +3216,6 @@ def tiff_palette4_img(tmp_path_factory, tmp_palette4_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "Palette", str(identify) assert identify[0]["image"].get("type") == "Palette", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("baseDepth") == 4, str(identify) assert identify[0]["image"].get("baseDepth") == 4, str(identify)
assert identify[0]["image"].get("colormapEntries") == 16, str(identify) assert identify[0]["image"].get("colormapEntries") == 16, str(identify)
@ -3435,10 +3228,6 @@ def tiff_palette4_img(tmp_path_factory, tmp_palette4_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette"
), str(identify) ), str(identify)
@ -3470,13 +3259,6 @@ def tiff_palette8_img(tmp_path_factory, tmp_palette8_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "Palette", str(identify) assert identify[0]["image"].get("type") == "Palette", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("colormapEntries") == 256, str(identify) assert identify[0]["image"].get("colormapEntries") == 256, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
@ -3488,10 +3270,6 @@ def tiff_palette8_img(tmp_path_factory, tmp_palette8_png):
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified" identify[0]["image"].get("properties", {}).get("tiff:alpha") == "unspecified"
), str(identify) ), str(identify)
assert (
identify[0]["image"].get("properties", {}).get("tiff:endian")
== BYTEORDER.lower()
), str(identify)
assert ( assert (
identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette" identify[0]["image"].get("properties", {}).get("tiff:photometric") == "palette"
), str(identify) ), str(identify)
@ -3541,9 +3319,7 @@ def tiff_ccitt_lsb_m2l_white_img(tmp_path_factory, tmp_gray1_png):
assert identify[0]["image"].get(endian) in [ assert identify[0]["image"].get(endian) in [
"Undefined", "Undefined",
"LSB", "LSB",
], str( ], str(identify)
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 1, str(identify) assert identify[0]["image"].get("depth") == 1, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3794,9 +3570,7 @@ def tiff_ccitt_lsb_m2l_black_img(tmp_path_factory, tmp_gray1_png):
assert identify[0]["image"].get(endian) in [ assert identify[0]["image"].get(endian) in [
"Undefined", "Undefined",
"LSB", "LSB",
], str( ], str(identify)
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 1, str(identify) assert identify[0]["image"].get("depth") == 1, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3887,9 +3661,7 @@ def tiff_ccitt_nometa1_img(tmp_path_factory, tmp_gray1_png):
assert identify[0]["image"].get(endian) in [ assert identify[0]["image"].get(endian) in [
"Undefined", "Undefined",
"LSB", "LSB",
], str( ], str(identify)
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 1, str(identify) assert identify[0]["image"].get("depth") == 1, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -3974,9 +3746,7 @@ def tiff_ccitt_nometa2_img(tmp_path_factory, tmp_gray1_png):
assert identify[0]["image"].get(endian) in [ assert identify[0]["image"].get(endian) in [
"Undefined", "Undefined",
"LSB", "LSB",
], str( ], str(identify)
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("colorspace") == "Gray", str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
assert identify[0]["image"].get("depth") == 1, str(identify) assert identify[0]["image"].get("depth") == 1, str(identify)
assert identify[0]["image"].get("compression") == "Group4", str(identify) assert identify[0]["image"].get("compression") == "Group4", str(identify)
@ -4042,13 +3812,6 @@ def miff_cmyk8_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "CMYK", str(identify) assert identify[0]["image"].get("colorspace") == "CMYK", str(identify)
assert identify[0]["image"].get("type") == "ColorSeparation", str(identify) assert identify[0]["image"].get("type") == "ColorSeparation", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,
@ -4093,13 +3856,6 @@ def miff_cmyk16_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "CMYK", str(identify) assert identify[0]["image"].get("colorspace") == "CMYK", str(identify)
assert identify[0]["image"].get("type") == "ColorSeparation", str(identify) assert identify[0]["image"].get("type") == "ColorSeparation", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 16, str(identify) assert identify[0]["image"].get("depth") == 16, str(identify)
assert identify[0]["image"].get("baseDepth") == 16, str(identify) assert identify[0]["image"].get("baseDepth") == 16, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
@ -4135,13 +3891,6 @@ def miff_rgb8_img(tmp_path_factory, tmp_normal_png):
}, str(identify) }, str(identify)
assert identify[0]["image"].get("colorspace") == "sRGB", str(identify) assert identify[0]["image"].get("colorspace") == "sRGB", str(identify)
assert identify[0]["image"].get("type") == "TrueColor", str(identify) assert identify[0]["image"].get("type") == "TrueColor", str(identify)
endian = "endianess" if identify[0].get("version", "0") < "1.0" else "endianness"
assert identify[0]["image"].get(endian) in [
"Undefined",
BYTEORDER,
], str(
identify
) # FIXME: should be LSB
assert identify[0]["image"].get("depth") == 8, str(identify) assert identify[0]["image"].get("depth") == 8, str(identify)
assert identify[0]["image"].get("pageGeometry") == { assert identify[0]["image"].get("pageGeometry") == {
"width": 60, "width": 60,