algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
228 stars 51 forks source link

tests/input/pdf/test_pdf.py test_to_jpeg fails with wand backend. #117

Closed JulienPalard closed 2 years ago

JulienPalard commented 4 years ago

Related to #113 (read first).

I'm getting:

    def test_to_jpeg() -> None:
        manager = PreviewManager(cache_folder_path=CACHE_DIR, create_folder=True)
        assert manager.has_jpeg_preview(file_path=IMAGE_FILE_PATH) is True
        path_to_file = manager.get_jpeg_preview(
            file_path=IMAGE_FILE_PATH, height=512, width=321, force=True
        )
        assert os.path.exists(path_to_file) is True
        assert os.path.getsize(path_to_file) > 0
        assert re.match(test_utils.CACHE_FILE_PATH_PATTERN__JPEG, path_to_file)

        with Image.open(path_to_file) as jpeg:
>           assert jpeg.height in range(453, 455)
E           assert 842 in range(453, 455)
E            +  where 842 = <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=595x842 at 0x7FA3923024B0>.height
E            +  and   range(453, 455) = range(453, 455)
inkhey commented 2 years ago

this has been fixed with both the improved wand backend #253