Checking to see that the saved image is the same as what we wrote
(self, tmp_path: Path)
| 128 | assert_image_equal_tofile(g4, "Tests/images/g4-fillorder-test.png") |
| 129 | |
| 130 | def test_g4_write(self, tmp_path: Path) -> None: |
| 131 | """Checking to see that the saved image is the same as what we wrote""" |
| 132 | test_file = "Tests/images/hopper_g4_500.tif" |
| 133 | with Image.open(test_file) as orig: |
| 134 | out = tmp_path / "temp.tif" |
| 135 | rot = orig.transpose(Image.Transpose.ROTATE_90) |
| 136 | assert rot.size == (500, 500) |
| 137 | rot.save(out) |
| 138 | |
| 139 | with Image.open(out) as reread: |
| 140 | assert reread.size == (500, 500) |
| 141 | self._assert_noerr(tmp_path, reread) |
| 142 | assert_image_equal(reread, rot) |
| 143 | assert reread.info["compression"] == "group4" |
| 144 | |
| 145 | assert reread.info["compression"] == orig.info["compression"] |
| 146 | |
| 147 | assert orig.tobytes() != reread.tobytes() |
| 148 | |
| 149 | def test_adobe_deflate_tiff(self) -> None: |
| 150 | test_file = "Tests/images/tiff_adobe_deflate.tif" |
nothing calls this directly
no test coverage detected