forked from josch/img2pdf
Compare commits
7 commits
8cbe03d486
...
6e6987c982
Author | SHA1 | Date | |
---|---|---|---|
|
6e6987c982 | ||
|
18c8825f41 | ||
|
9299ba8f33 | ||
|
6310ca0dee | ||
|
0d90ec6768 | ||
|
06b4a4902a | ||
|
87d524bab0 |
3 changed files with 178 additions and 24 deletions
12
README.md
12
README.md
|
@ -80,17 +80,7 @@ Bugs
|
||||||
- Input images with alpha channels are not allowed. PDF only supports
|
- Input images with alpha channels are not allowed. PDF only supports
|
||||||
transparency using binary masks but is unable to store 8-bit transparency
|
transparency using binary masks but is unable to store 8-bit transparency
|
||||||
information as part of the image itself. But img2pdf will always be lossless
|
information as part of the image itself. But img2pdf will always be lossless
|
||||||
and thus, input images must not carry transparency information. You can
|
and thus, input images must not carry transparency information.
|
||||||
remove the alpha channel for example with imagemagick:
|
|
||||||
|
|
||||||
convert input.png -background white -alpha remove -alpha off output.png
|
|
||||||
|
|
||||||
- An error is produced if the input image is broken. This commonly happens if
|
|
||||||
the input image has an invalid EXIF Orientation value of zero. Even though
|
|
||||||
only nine different values from 1 to 9 are permitted, Anroid phones and
|
|
||||||
Canon DSLR cameras produce JPEG images with the invalid value of zero.
|
|
||||||
Either fix your input images with `exiftool` or similar software before
|
|
||||||
passing the JPEG to `img2pdf` or run `img2pdf` with `--rotation=ifvalid`.
|
|
||||||
|
|
||||||
- img2pdf uses PIL (or Pillow) to obtain image meta data and to convert the
|
- img2pdf uses PIL (or Pillow) to obtain image meta data and to convert the
|
||||||
input if necessary. To prevent decompression bomb denial of service attacks,
|
input if necessary. To prevent decompression bomb denial of service attacks,
|
||||||
|
|
|
@ -2747,6 +2747,7 @@ def gui():
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
"engine": tkinter.StringVar(),
|
"engine": tkinter.StringVar(),
|
||||||
|
"first_frame_only": tkinter.BooleanVar(),
|
||||||
"auto_orient": tkinter.BooleanVar(),
|
"auto_orient": tkinter.BooleanVar(),
|
||||||
"fit": tkinter.StringVar(),
|
"fit": tkinter.StringVar(),
|
||||||
"title": tkinter.StringVar(),
|
"title": tkinter.StringVar(),
|
||||||
|
@ -3706,9 +3707,8 @@ ifvalid, 0, 90, 180 and 270. The default value is auto and indicates that input
|
||||||
images are rotated according to their EXIF Orientation tag. The values none and
|
images are rotated according to their EXIF Orientation tag. The values none and
|
||||||
0 ignore the EXIF Orientation values of the input images. The value ifvalid
|
0 ignore the EXIF Orientation values of the input images. The value ifvalid
|
||||||
acts like auto but ignores invalid EXIF rotation values and only issues a
|
acts like auto but ignores invalid EXIF rotation values and only issues a
|
||||||
warning instead of throwing an error. This is useful because many devices like
|
warning instead of throwing an error. The values 90, 180 and 270 perform a
|
||||||
Android phones, Canon cameras or scanners emit an invalid Orientation tag value
|
clockwise rotation of the image.
|
||||||
of zero. The values 90, 180 and 270 perform a clockwise rotation of the image.
|
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
sizeargs.add_argument(
|
sizeargs.add_argument(
|
||||||
|
|
|
@ -304,11 +304,7 @@ def compare(im1, im2, exact, icc, cmyk):
|
||||||
else:
|
else:
|
||||||
iccargs = []
|
iccargs = []
|
||||||
if icc:
|
if icc:
|
||||||
profile = "/usr/share/color/icc/sRGB.icc"
|
iccargs = ["-profile", "/usr/share/color/icc/sRGB.icc"]
|
||||||
if not os.path.isfile(profile):
|
|
||||||
warnings.warn(profile + " not present, skipping checks...")
|
|
||||||
return
|
|
||||||
iccargs = ["-profile", profile]
|
|
||||||
psnr = subprocess.run(
|
psnr = subprocess.run(
|
||||||
["compare"]
|
["compare"]
|
||||||
+ iccargs
|
+ iccargs
|
||||||
|
@ -438,10 +434,6 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if icc:
|
if icc:
|
||||||
profile = "/usr/share/color/icc/ghostscript/srgb.icc"
|
|
||||||
if not os.path.isfile(profile):
|
|
||||||
warnings.warn(profile + " not present, skipping checks...")
|
|
||||||
return
|
|
||||||
psnr = subprocess.run(
|
psnr = subprocess.run(
|
||||||
[
|
[
|
||||||
"compare",
|
"compare",
|
||||||
|
@ -449,7 +441,7 @@ def compare_pdfimages_png(tmpdir, img, pdf, exact=True, icc=False):
|
||||||
"PSNR",
|
"PSNR",
|
||||||
"(",
|
"(",
|
||||||
"-profile",
|
"-profile",
|
||||||
profile,
|
"/usr/share/color/icc/ghostscript/srgb.icc",
|
||||||
"-depth",
|
"-depth",
|
||||||
"8",
|
"8",
|
||||||
str(img),
|
str(img),
|
||||||
|
@ -993,6 +985,10 @@ def jpg_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
== "Joint Photographic Experts Group JFIF format"
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1049,6 +1045,10 @@ def jpg_rot_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
== "Joint Photographic Experts Group JFIF format"
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1088,6 +1088,10 @@ def jpg_cmyk_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
assert identify[0]["image"].get("format") == "JPEG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
== "Joint Photographic Experts Group JFIF format"
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/jpeg", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1122,6 +1126,9 @@ def jpg_2000_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "JP2", str(identify)
|
assert identify[0]["image"].get("format") == "JP2", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["JPEG-2000 File Format Syntax", "JP2"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/jp2", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/jp2", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1155,6 +1162,9 @@ def png_rgb8_img(tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1205,6 +1215,9 @@ def png_rgb16_img(tmp_normal16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1259,6 +1272,9 @@ def png_rgba8_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1310,6 +1326,9 @@ def png_rgba16_img(tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1377,6 +1396,9 @@ def png_gray8a_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1440,6 +1462,9 @@ def png_gray16a_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1495,6 +1520,9 @@ def png_interlaced_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1547,6 +1575,9 @@ def png_gray1_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1598,6 +1629,9 @@ def png_gray2_img(tmp_path_factory, tmp_gray2_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1649,6 +1683,9 @@ def png_gray4_img(tmp_path_factory, tmp_gray4_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1700,6 +1737,9 @@ def png_gray8_img(tmp_path_factory, tmp_gray8_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1751,6 +1791,9 @@ def png_gray16_img(tmp_path_factory, tmp_gray16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1803,6 +1846,9 @@ def png_palette1_img(tmp_path_factory, tmp_palette1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1854,6 +1900,9 @@ def png_palette2_img(tmp_path_factory, tmp_palette2_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1905,6 +1954,9 @@ def png_palette4_img(tmp_path_factory, tmp_palette4_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -1956,6 +2008,9 @@ def png_palette8_img(tmp_path_factory, tmp_palette8_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2007,6 +2062,10 @@ def gif_transparent_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2042,6 +2101,10 @@ def gif_palette1_img(tmp_path_factory, tmp_palette1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2077,6 +2140,10 @@ def gif_palette2_img(tmp_path_factory, tmp_palette2_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2112,6 +2179,10 @@ def gif_palette4_img(tmp_path_factory, tmp_palette4_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2147,6 +2218,10 @@ def gif_palette8_img(tmp_path_factory, tmp_palette8_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2186,6 +2261,10 @@ def gif_animation_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2215,6 +2294,10 @@ def gif_animation_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
assert identify[0]["image"].get("format") == "GIF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"]["formatDescription"]
|
||||||
|
in ["CompuServe graphics interchange format", "GIF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/gif", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2261,6 +2344,9 @@ def tiff_float_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2323,6 +2409,9 @@ def tiff_cmyk8_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2383,6 +2472,9 @@ def tiff_cmyk16_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2439,6 +2531,9 @@ def tiff_rgb8_img(tmp_path_factory, tmp_normal_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2496,6 +2591,9 @@ def tiff_rgb12_img(tmp_path_factory, tmp_normal16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2557,6 +2655,9 @@ def tiff_rgb14_img(tmp_path_factory, tmp_normal16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2618,6 +2719,9 @@ def tiff_rgb16_img(tmp_path_factory, tmp_normal16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2676,6 +2780,9 @@ def tiff_rgba8_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2734,6 +2841,9 @@ def tiff_rgba16_img(tmp_path_factory, tmp_alpha_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2791,6 +2901,9 @@ def tiff_gray1_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2849,6 +2962,9 @@ def tiff_gray2_img(tmp_path_factory, tmp_gray2_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2907,6 +3023,9 @@ def tiff_gray4_img(tmp_path_factory, tmp_gray4_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -2965,6 +3084,9 @@ def tiff_gray8_img(tmp_path_factory, tmp_gray8_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3023,6 +3145,9 @@ def tiff_gray16_img(tmp_path_factory, tmp_gray16_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3083,6 +3208,9 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3124,6 +3252,9 @@ def tiff_multipage_img(tmp_path_factory, tmp_normal_png, tmp_inverse_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3180,6 +3311,9 @@ def tiff_palette1_img(tmp_path_factory, tmp_palette1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3237,6 +3371,9 @@ def tiff_palette2_img(tmp_path_factory, tmp_palette2_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3294,6 +3431,9 @@ def tiff_palette4_img(tmp_path_factory, tmp_palette4_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3351,6 +3491,9 @@ def tiff_palette8_img(tmp_path_factory, tmp_palette8_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3415,6 +3558,9 @@ def tiff_ccitt_lsb_m2l_white_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3496,6 +3642,9 @@ def tiff_ccitt_msb_m2l_white_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3578,6 +3727,9 @@ def tiff_ccitt_msb_l2m_white_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3665,6 +3817,9 @@ def tiff_ccitt_lsb_m2l_black_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3755,6 +3910,9 @@ def tiff_ccitt_nometa1_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3839,6 +3997,9 @@ def tiff_ccitt_nometa2_img(tmp_path_factory, tmp_gray1_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
assert identify[0]["image"].get("format") == "TIFF", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Tagged Image File Format", "TIFF"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/tiff", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
@ -3898,6 +4059,9 @@ def png_icc_img(tmp_icc_png):
|
||||||
identify = [identify]
|
identify = [identify]
|
||||||
assert "image" in identify[0]
|
assert "image" in identify[0]
|
||||||
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
assert identify[0]["image"].get("format") == "PNG", str(identify)
|
||||||
|
assert (
|
||||||
|
identify[0]["image"].get("formatDescription") in ["Portable Network Graphics", "PNG"]
|
||||||
|
), str(identify)
|
||||||
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
|
||||||
assert identify[0]["image"].get("geometry") == {
|
assert identify[0]["image"].get("geometry") == {
|
||||||
"width": 60,
|
"width": 60,
|
||||||
|
|
Loading…
Reference in a new issue