fix tests

This commit is contained in:
John Cupitt 2016-07-26 17:28:54 +01:00
parent e2eb1b8c12
commit d388f666cb
2 changed files with 4 additions and 6 deletions

View File

@ -800,7 +800,7 @@ vips_foreign_load_gif_buffer_class_init(
object_class->description = _( "load GIF with giflib" );
load_class->is_a_buffer = vips_foreign_load_gif_is_a_buffer;
load_class->load = vips_foreign_load_gif_buffer_header;
load_class->header = vips_foreign_load_gif_buffer_header;
VIPS_ARG_BOXED( class, "buffer", 1,
_( "Buffer" ),

View File

@ -58,9 +58,7 @@ class TestForeign(unittest.TestCase):
self.cmyk = self.cmyk.copy(interpretation = Vips.Interpretation.CMYK)
im = Vips.Image.new_from_file(self.gif_file)
# some libMagick will load this mono image as RGB, some as mono ... test
# band 0 to be safe
self.onebit = im[0] > 128
self.onebit = im > 128
# we have test files for formats which have a clear standard
def file_loader(self, loader, test_file, validate):
@ -475,10 +473,10 @@ class TestForeign(unittest.TestCase):
def gif_valid(self, im):
a = im(10, 10)
self.assertAlmostEqualObjects(a, [33, 33, 33, 255])
self.assertAlmostEqualObjects(a, [33])
self.assertEqual(im.width, 159)
self.assertEqual(im.height, 203)
self.assertEqual(im.bands, 4)
self.assertEqual(im.bands, 1)
self.file_loader("gifload", self.gif_file, gif_valid)
self.buffer_loader("gifload_buffer", self.gif_file, gif_valid)