move libtiff-related tests into libtiff test file

This commit is contained in:
Konstantin Kopachev 2018-07-16 21:41:32 -07:00
parent 1f63abdba8
commit 52637a4268
No known key found for this signature in database
GPG Key ID: CECF757E656F4F62
2 changed files with 37 additions and 36 deletions

View File

@ -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()

View File

@ -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