diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 7735b5bea..c77c2ffb2 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -635,6 +635,43 @@ class TestFileLibTiff(LibTiffTestCase): im2 = hopper() self.assert_image_similar(im, im2, 5) + def test_strip_cmyk_jpeg(self): + infile = "Tests/images/tiff_strip_cmyk_jpeg.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/pil_sample_cmyk.jpg", 3, mode='CMYK') + + def test_strip_ycbcr_jpeg_2x2_sampling(self): + infile = "Tests/images/tiff_strip_ycbcr_jpeg_2x2_sampling.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 2) + + def test_strip_ycbcr_jpeg_1x1_sampling(self): + infile = "Tests/images/tiff_strip_ycbcr_jpeg_1x1_sampling.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 5) + + def test_tiled_cmyk_jpeg(self): + infile = "Tests/images/tiff_tiled_cmyk_jpeg.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/pil_sample_cmyk.jpg", 3.5, mode='CMYK') + + def test_tiled_ycbcr_jpeg_1x1_sampling(self): + infile = "Tests/images/tiff_tiled_ycbcr_jpeg_1x1_sampling.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 5) + + def test_tiled_ycbcr_jpeg_2x2_sampling(self): + infile = "Tests/images/tiff_tiled_ycbcr_jpeg_2x2_sampling.tif" + im = Image.open(infile) + + self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 1) + + if __name__ == '__main__': unittest.main() diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 99afed52b..a8a893883 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -422,48 +422,12 @@ class TestFileTiff(PillowTestCase): self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png") - def test_strip_cmyk_jpeg(self): - infile = "Tests/images/tiff_strip_cmyk_jpeg.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/pil_sample_cmyk.jpg", 3, mode='CMYK') - - def test_strip_ycbcr_jpeg_2x2_sampling(self): - infile = "Tests/images/tiff_strip_ycbcr_jpeg_2x2_sampling.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 2) - - def test_strip_ycbcr_jpeg_1x1_sampling(self): - infile = "Tests/images/tiff_strip_ycbcr_jpeg_1x1_sampling.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 5) - def test_tiled_raw(self): infile = "Tests/images/tiff_tiled_raw.tif" im = Image.open(infile) self.assert_image_equal_tofile(im, "Tests/images/tiff_adobe_deflate.png") - def test_tiled_cmyk_jpeg(self): - infile = "Tests/images/tiff_tiled_cmyk_jpeg.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/pil_sample_cmyk.jpg", 3.5, mode='CMYK') - - def test_tiled_ycbcr_jpeg_1x1_sampling(self): - infile = "Tests/images/tiff_tiled_ycbcr_jpeg_1x1_sampling.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 5) - - def test_tiled_ycbcr_jpeg_2x2_sampling(self): - infile = "Tests/images/tiff_tiled_ycbcr_jpeg_2x2_sampling.tif" - im = Image.open(infile) - - self.assert_image_similar_tofile(im, "Tests/images/flower.jpg", 1) - def test_tiff_save_all(self): import io import os