diff --git a/ocrd_utils/ocrd_utils/image.py b/ocrd_utils/ocrd_utils/image.py index 5751c78be..83e8fc9ee 100644 --- a/ocrd_utils/ocrd_utils/image.py +++ b/ocrd_utils/ocrd_utils/image.py @@ -6,6 +6,10 @@ from .logging import getLogger from .introspect import membername +# Allow processing of images with up to 1.6bn pixels +# https://github.com/OCR-D/core/issues/735 +Image.MAX_IMAGE_PIXELS = 40_000 ** 2 + __all__ = [ 'adjust_canvas_to_rotation', 'adjust_canvas_to_transposition', diff --git a/tests/utils/test_image.py b/tests/utils/test_image.py index 24e13c6ff..936add272 100644 --- a/tests/utils/test_image.py +++ b/tests/utils/test_image.py @@ -6,5 +6,8 @@ def test_32bit_fill(): img = Image.new('F', (200, 100), 1) rotate_image(img, 0.1, fill='background', transparency=False) +def test_max_image_pixels(): + assert Image.MAX_IMAGE_PIXELS == 40_000 ** 2 + if __name__ == '__main__': main([__file__])