add some tests
This commit is contained in:
parent
4ba083437a
commit
d54df515b8
@ -41,7 +41,7 @@
|
|||||||
- added VIPS_ROUND as well as VIPS_RINT
|
- added VIPS_ROUND as well as VIPS_RINT
|
||||||
- resize/reduce*/shrink*/affine now round output size to nearest rather than
|
- resize/reduce*/shrink*/affine now round output size to nearest rather than
|
||||||
rounding down, thanks ioquatix
|
rounding down, thanks ioquatix
|
||||||
- better overlap support for google maps in dzsave
|
- better support for tile overlaps in google maps mode in dzsave
|
||||||
|
|
||||||
19/8/16 started 8.3.4
|
19/8/16 started 8.3.4
|
||||||
- better transparency handling in gifload, thanks diegocsandrim
|
- better transparency handling in gifload, thanks diegocsandrim
|
||||||
|
@ -438,6 +438,8 @@ vips_gsf_dir_new( VipsGsfDirectory *parent, const char *name )
|
|||||||
(GsfOutfile *) parent->out,
|
(GsfOutfile *) parent->out,
|
||||||
name, TRUE );
|
name, TRUE );
|
||||||
|
|
||||||
|
g_assert( dir->out );
|
||||||
|
|
||||||
parent->children = g_slist_prepend( parent->children, dir );
|
parent->children = g_slist_prepend( parent->children, dir );
|
||||||
|
|
||||||
return( dir );
|
return( dir );
|
||||||
|
@ -579,7 +579,7 @@ class TestForeign(unittest.TestCase):
|
|||||||
# test the overlap for equality
|
# test the overlap for equality
|
||||||
self.colour.dzsave("test", suffix = ".png")
|
self.colour.dzsave("test", suffix = ".png")
|
||||||
|
|
||||||
# tes horizontal overlap ... expect 256 step, overlap 1
|
# test horizontal overlap ... expect 256 step, overlap 1
|
||||||
x = Vips.Image.new_from_file("test_files/10/0_0.png")
|
x = Vips.Image.new_from_file("test_files/10/0_0.png")
|
||||||
self.assertEqual(x.width, 255)
|
self.assertEqual(x.width, 255)
|
||||||
y = Vips.Image.new_from_file("test_files/10/1_0.png")
|
y = Vips.Image.new_from_file("test_files/10/1_0.png")
|
||||||
@ -626,6 +626,31 @@ class TestForeign(unittest.TestCase):
|
|||||||
|
|
||||||
shutil.rmtree("test")
|
shutil.rmtree("test")
|
||||||
|
|
||||||
|
# google layout with overlap ... verify that we clip correctly
|
||||||
|
# with overlap 192 tile size 256, we should step by 64 pixels each time
|
||||||
|
# so 3x3 tiles exactly
|
||||||
|
self.colour.crop(0, 0, 384, 384).dzsave("test2", layout = "google",
|
||||||
|
overlap = 192, depth = "one")
|
||||||
|
|
||||||
|
# test bottom-right tile ... default is 256x256 tiles, overlap 0
|
||||||
|
x = Vips.Image.new_from_file("test2/0/2/2.jpg")
|
||||||
|
self.assertEqual(x.width, 256)
|
||||||
|
self.assertEqual(x.height, 256)
|
||||||
|
self.assertFalse(os.path.exists("test2/0/3/3.jpg"))
|
||||||
|
|
||||||
|
shutil.rmtree("test2")
|
||||||
|
|
||||||
|
self.colour.crop(0, 0, 385, 385).dzsave("test3", layout = "google",
|
||||||
|
overlap = 192, depth = "one")
|
||||||
|
|
||||||
|
# test bottom-right tile ... default is 256x256 tiles, overlap 0
|
||||||
|
x = Vips.Image.new_from_file("test3/0/3/3.jpg")
|
||||||
|
self.assertEqual(x.width, 256)
|
||||||
|
self.assertEqual(x.height, 256)
|
||||||
|
self.assertFalse(os.path.exists("test3/0/4/4.jpg"))
|
||||||
|
|
||||||
|
shutil.rmtree("test3")
|
||||||
|
|
||||||
# default zoomify layout
|
# default zoomify layout
|
||||||
self.colour.dzsave("test", layout = "zoomify")
|
self.colour.dzsave("test", layout = "zoomify")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user