Test failures with ImageMagick 7.1.0-60 #154

Closed
opened 1 year ago by Ghost · 2 comments
Ghost commented 1 year ago
============================= test session starts ==============================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0
rootdir: /build/img2pdf-0.4.4
collected 301 items / 12 deselected / 289 selected

src/img2pdf_test.py ......ss..............EE................ss.......... [ 17%]
........................................................................ [ 42%]
........................................................................ [ 67%]
........................................................................ [ 92%]
.....................                                                    [100%]

==================================== ERRORS ====================================
__________________ ERROR at setup of test_png_gray1[internal] __________________

tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ffff6880eb0>, _basetemp=PosixPath('/build/pytest-of-nixbld/pytest-0'))
tmp_gray1_png = PosixPath('/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png')

    @pytest.fixture(scope="session")
    def png_gray1_img(tmp_path_factory, tmp_gray1_png):
        identify = json.loads(
            subprocess.check_output(CONVERT + [str(tmp_gray1_png), "json:"])
        )
        assert len(identify) == 1
        # somewhere between imagemagick 6.9.7.4 and 6.9.9.34, the json output was
        # put into an array, here we cater for the older version containing just
        # the bare dictionary
        if "image" in identify:
            identify = [identify]
        assert "image" in identify[0]
        assert identify[0]["image"].get("format") == "PNG", str(identify)
        assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
        assert identify[0]["image"].get("geometry") == {
            "width": 60,
            "height": 60,
            "x": 0,
            "y": 0,
        }, str(identify)
        assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
>       assert identify[0]["image"].get("type") == "Bilevel", str(identify)
E       AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png', 'baseName': 'gray1.png', 'permissions': 644, 'format': 'PNG', 'formatDescription': 'Portable Network Graphics', 'mimeType': 'image/png', 'class': 'PseudoClass', 'geometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'units': 'Undefined', 'type': 'Grayscale', 'endianness': 'Undefined', 'colorspace': 'Gray', 'depth': 1, 'baseDepth': 1, 'channelDepth': {'gray': 1}, 'pixels': 3600, 'channelStatistics': {'gray': {'min': 0, 'max': 1, 'mean': 0.436111, 'median': 0, 'standardDeviation': 0.49597, 'kurtosis': -1.9342, 'skewness': 0.25756, 'entropy': 0.98819}}, 'colormapEntries': 2, 'colormap': ['#000000FF', '#FFFFFFFF'], 'renderingIntent': 'Undefined', 'gamma': 0.454545, 'matteColor': '#BDBDBDBDBDBD', 'backgroundColor': '#FFFFFFFFFFFF', 'borderColor': '#DFDFDFDFDFDF', 'transparentColor': '#000000000000', 'interlace': 'None', 'intensity': 'Undefined', 'compose': 'Over', 'pageGeometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'dispose': 'Undefined', 'iterations': 0, 'compression': 'Zip', 'orientation': 'Undefined', 'properties': {'png:IHDR.bit-depth-orig': '1', 'png:IHDR.bit_depth': '1', 'png:IHDR.color-type-orig': '0', 'png:IHDR.color_type': '0 (Grayscale)', 'png:IHDR.interlace_method': '0 (Not interlaced)', 'png:IHDR.width,height': '60, 60', 'signature': '7cb2a4f4df5f29f3dcd3713b56f19caeb1074bdfee5baa5bfc3579735e655f66'}, 'tainted': False, 'filesize': '608B', 'numberPixels': '3600', 'pixelsPerSecond': '7.20669MB', 'userTime': '0.000u', 'elapsedTime': '0:01.000', 'version': 'ImageMagick 7.1.0-60 Q16-HDRI x86_64 d50c8c51f:20230129 https://imagemagick.org'}}]
E       assert 'Grayscale' == 'Bilevel'
E         - Bilevel
E         + Grayscale

src/img2pdf_test.py:1602: AssertionError
__________________ ERROR at setup of test_png_gray1[pikepdf] ___________________

tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ffff6880eb0>, _basetemp=PosixPath('/build/pytest-of-nixbld/pytest-0'))
tmp_gray1_png = PosixPath('/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png')

    @pytest.fixture(scope="session")
    def png_gray1_img(tmp_path_factory, tmp_gray1_png):
        identify = json.loads(
            subprocess.check_output(CONVERT + [str(tmp_gray1_png), "json:"])
        )
        assert len(identify) == 1
        # somewhere between imagemagick 6.9.7.4 and 6.9.9.34, the json output was
        # put into an array, here we cater for the older version containing just
        # the bare dictionary
        if "image" in identify:
            identify = [identify]
        assert "image" in identify[0]
        assert identify[0]["image"].get("format") == "PNG", str(identify)
        assert identify[0]["image"].get("mimeType") == "image/png", str(identify)
        assert identify[0]["image"].get("geometry") == {
            "width": 60,
            "height": 60,
            "x": 0,
            "y": 0,
        }, str(identify)
        assert identify[0]["image"].get("colorspace") == "Gray", str(identify)
>       assert identify[0]["image"].get("type") == "Bilevel", str(identify)
E       AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png', 'baseName': 'gray1.png', 'permissions': 644, 'format': 'PNG', 'formatDescription': 'Portable Network Graphics', 'mimeType': 'image/png', 'class': 'PseudoClass', 'geometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'units': 'Undefined', 'type': 'Grayscale', 'endianness': 'Undefined', 'colorspace': 'Gray', 'depth': 1, 'baseDepth': 1, 'channelDepth': {'gray': 1}, 'pixels': 3600, 'channelStatistics': {'gray': {'min': 0, 'max': 1, 'mean': 0.436111, 'median': 0, 'standardDeviation': 0.49597, 'kurtosis': -1.9342, 'skewness': 0.25756, 'entropy': 0.98819}}, 'colormapEntries': 2, 'colormap': ['#000000FF', '#FFFFFFFF'], 'renderingIntent': 'Undefined', 'gamma': 0.454545, 'matteColor': '#BDBDBDBDBDBD', 'backgroundColor': '#FFFFFFFFFFFF', 'borderColor': '#DFDFDFDFDFDF', 'transparentColor': '#000000000000', 'interlace': 'None', 'intensity': 'Undefined', 'compose': 'Over', 'pageGeometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'dispose': 'Undefined', 'iterations': 0, 'compression': 'Zip', 'orientation': 'Undefined', 'properties': {'png:IHDR.bit-depth-orig': '1', 'png:IHDR.bit_depth': '1', 'png:IHDR.color-type-orig': '0', 'png:IHDR.color_type': '0 (Grayscale)', 'png:IHDR.interlace_method': '0 (Not interlaced)', 'png:IHDR.width,height': '60, 60', 'signature': '7cb2a4f4df5f29f3dcd3713b56f19caeb1074bdfee5baa5bfc3579735e655f66'}, 'tainted': False, 'filesize': '608B', 'numberPixels': '3600', 'pixelsPerSecond': '7.20669MB', 'userTime': '0.000u', 'elapsedTime': '0:01.000', 'version': 'ImageMagick 7.1.0-60 Q16-HDRI x86_64 d50c8c51f:20230129 https://imagemagick.org'}}]
E       assert 'Grayscale' == 'Bilevel'
E         - Bilevel
E         + Grayscale

src/img2pdf_test.py:1602: AssertionError
=============================== warnings summary ===============================
src/img2pdf_test.py:120
  /build/img2pdf-0.4.4/src/img2pdf_test.py:120: UserWarning: imagemagick has no jpeg 2000 support, skipping certain checks...
    warnings.warn("imagemagick has no jpeg 2000 support, skipping certain checks...")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR src/img2pdf_test.py::test_png_gray1[internal] - AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nix...
ERROR src/img2pdf_test.py::test_png_gray1[pikepdf] - AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nix...
= 283 passed, 4 skipped, 12 deselected, 1 warning, 2 errors in 73.19s (0:01:13) =
``` ============================= test session starts ============================== platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0 rootdir: /build/img2pdf-0.4.4 collected 301 items / 12 deselected / 289 selected src/img2pdf_test.py ......ss..............EE................ss.......... [ 17%] ........................................................................ [ 42%] ........................................................................ [ 67%] ........................................................................ [ 92%] ..................... [100%] ==================================== ERRORS ==================================== __________________ ERROR at setup of test_png_gray1[internal] __________________ tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ffff6880eb0>, _basetemp=PosixPath('/build/pytest-of-nixbld/pytest-0')) tmp_gray1_png = PosixPath('/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png') @pytest.fixture(scope="session") def png_gray1_img(tmp_path_factory, tmp_gray1_png): identify = json.loads( subprocess.check_output(CONVERT + [str(tmp_gray1_png), "json:"]) ) assert len(identify) == 1 # somewhere between imagemagick 6.9.7.4 and 6.9.9.34, the json output was # put into an array, here we cater for the older version containing just # the bare dictionary if "image" in identify: identify = [identify] assert "image" in identify[0] assert identify[0]["image"].get("format") == "PNG", str(identify) assert identify[0]["image"].get("mimeType") == "image/png", str(identify) assert identify[0]["image"].get("geometry") == { "width": 60, "height": 60, "x": 0, "y": 0, }, str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify) > assert identify[0]["image"].get("type") == "Bilevel", str(identify) E AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png', 'baseName': 'gray1.png', 'permissions': 644, 'format': 'PNG', 'formatDescription': 'Portable Network Graphics', 'mimeType': 'image/png', 'class': 'PseudoClass', 'geometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'units': 'Undefined', 'type': 'Grayscale', 'endianness': 'Undefined', 'colorspace': 'Gray', 'depth': 1, 'baseDepth': 1, 'channelDepth': {'gray': 1}, 'pixels': 3600, 'channelStatistics': {'gray': {'min': 0, 'max': 1, 'mean': 0.436111, 'median': 0, 'standardDeviation': 0.49597, 'kurtosis': -1.9342, 'skewness': 0.25756, 'entropy': 0.98819}}, 'colormapEntries': 2, 'colormap': ['#000000FF', '#FFFFFFFF'], 'renderingIntent': 'Undefined', 'gamma': 0.454545, 'matteColor': '#BDBDBDBDBDBD', 'backgroundColor': '#FFFFFFFFFFFF', 'borderColor': '#DFDFDFDFDFDF', 'transparentColor': '#000000000000', 'interlace': 'None', 'intensity': 'Undefined', 'compose': 'Over', 'pageGeometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'dispose': 'Undefined', 'iterations': 0, 'compression': 'Zip', 'orientation': 'Undefined', 'properties': {'png:IHDR.bit-depth-orig': '1', 'png:IHDR.bit_depth': '1', 'png:IHDR.color-type-orig': '0', 'png:IHDR.color_type': '0 (Grayscale)', 'png:IHDR.interlace_method': '0 (Not interlaced)', 'png:IHDR.width,height': '60, 60', 'signature': '7cb2a4f4df5f29f3dcd3713b56f19caeb1074bdfee5baa5bfc3579735e655f66'}, 'tainted': False, 'filesize': '608B', 'numberPixels': '3600', 'pixelsPerSecond': '7.20669MB', 'userTime': '0.000u', 'elapsedTime': '0:01.000', 'version': 'ImageMagick 7.1.0-60 Q16-HDRI x86_64 d50c8c51f:20230129 https://imagemagick.org'}}] E assert 'Grayscale' == 'Bilevel' E - Bilevel E + Grayscale src/img2pdf_test.py:1602: AssertionError __________________ ERROR at setup of test_png_gray1[pikepdf] ___________________ tmp_path_factory = TempPathFactory(_given_basetemp=None, _trace=<pluggy._tracing.TagTracerSub object at 0x7ffff6880eb0>, _basetemp=PosixPath('/build/pytest-of-nixbld/pytest-0')) tmp_gray1_png = PosixPath('/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png') @pytest.fixture(scope="session") def png_gray1_img(tmp_path_factory, tmp_gray1_png): identify = json.loads( subprocess.check_output(CONVERT + [str(tmp_gray1_png), "json:"]) ) assert len(identify) == 1 # somewhere between imagemagick 6.9.7.4 and 6.9.9.34, the json output was # put into an array, here we cater for the older version containing just # the bare dictionary if "image" in identify: identify = [identify] assert "image" in identify[0] assert identify[0]["image"].get("format") == "PNG", str(identify) assert identify[0]["image"].get("mimeType") == "image/png", str(identify) assert identify[0]["image"].get("geometry") == { "width": 60, "height": 60, "x": 0, "y": 0, }, str(identify) assert identify[0]["image"].get("colorspace") == "Gray", str(identify) > assert identify[0]["image"].get("type") == "Bilevel", str(identify) E AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nixbld/pytest-0/gray1_png0/gray1.png', 'baseName': 'gray1.png', 'permissions': 644, 'format': 'PNG', 'formatDescription': 'Portable Network Graphics', 'mimeType': 'image/png', 'class': 'PseudoClass', 'geometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'units': 'Undefined', 'type': 'Grayscale', 'endianness': 'Undefined', 'colorspace': 'Gray', 'depth': 1, 'baseDepth': 1, 'channelDepth': {'gray': 1}, 'pixels': 3600, 'channelStatistics': {'gray': {'min': 0, 'max': 1, 'mean': 0.436111, 'median': 0, 'standardDeviation': 0.49597, 'kurtosis': -1.9342, 'skewness': 0.25756, 'entropy': 0.98819}}, 'colormapEntries': 2, 'colormap': ['#000000FF', '#FFFFFFFF'], 'renderingIntent': 'Undefined', 'gamma': 0.454545, 'matteColor': '#BDBDBDBDBDBD', 'backgroundColor': '#FFFFFFFFFFFF', 'borderColor': '#DFDFDFDFDFDF', 'transparentColor': '#000000000000', 'interlace': 'None', 'intensity': 'Undefined', 'compose': 'Over', 'pageGeometry': {'width': 60, 'height': 60, 'x': 0, 'y': 0}, 'dispose': 'Undefined', 'iterations': 0, 'compression': 'Zip', 'orientation': 'Undefined', 'properties': {'png:IHDR.bit-depth-orig': '1', 'png:IHDR.bit_depth': '1', 'png:IHDR.color-type-orig': '0', 'png:IHDR.color_type': '0 (Grayscale)', 'png:IHDR.interlace_method': '0 (Not interlaced)', 'png:IHDR.width,height': '60, 60', 'signature': '7cb2a4f4df5f29f3dcd3713b56f19caeb1074bdfee5baa5bfc3579735e655f66'}, 'tainted': False, 'filesize': '608B', 'numberPixels': '3600', 'pixelsPerSecond': '7.20669MB', 'userTime': '0.000u', 'elapsedTime': '0:01.000', 'version': 'ImageMagick 7.1.0-60 Q16-HDRI x86_64 d50c8c51f:20230129 https://imagemagick.org'}}] E assert 'Grayscale' == 'Bilevel' E - Bilevel E + Grayscale src/img2pdf_test.py:1602: AssertionError =============================== warnings summary =============================== src/img2pdf_test.py:120 /build/img2pdf-0.4.4/src/img2pdf_test.py:120: UserWarning: imagemagick has no jpeg 2000 support, skipping certain checks... warnings.warn("imagemagick has no jpeg 2000 support, skipping certain checks...") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ ERROR src/img2pdf_test.py::test_png_gray1[internal] - AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nix... ERROR src/img2pdf_test.py::test_png_gray1[pikepdf] - AssertionError: [{'version': '1.0', 'image': {'name': '/build/pytest-of-nix... = 283 passed, 4 skipped, 12 deselected, 1 warning, 2 errors in 73.19s (0:01:13) = ```
Owner

@gms do you also see this issue on Fedora with imagemagick 7.1?

@gms do you also see this issue on Fedora with imagemagick 7.1?
Owner

Ah yes, you do. You reported this as #161

I'm closing this one in favour of #161

Ah yes, you do. You reported this as #161 I'm closing this one in favour of #161
josch closed this issue 11 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#154
Loading…
There is no content yet.