(shared_datadir)
| 79 | |
| 80 | @require_pil |
| 81 | def test_image_decode_example(shared_datadir): |
| 82 | import PIL.Image |
| 83 | |
| 84 | image_path = str(shared_datadir / "test_image_rgb.jpg") |
| 85 | image = Image() |
| 86 | decoded_example = image.decode_example({"path": image_path, "bytes": None}) |
| 87 | |
| 88 | assert isinstance(decoded_example, PIL.Image.Image) |
| 89 | assert os.path.samefile(decoded_example.filename, image_path) |
| 90 | assert decoded_example.size == (640, 480) |
| 91 | assert decoded_example.mode == "RGB" |
| 92 | |
| 93 | with pytest.raises(RuntimeError): |
| 94 | Image(decode=False).decode_example(image_path) |
| 95 | |
| 96 | |
| 97 | @require_pil |
nothing calls this directly
no test coverage detected