add test for new ICO sniffer

This commit is contained in:
John Cupitt 2018-07-25 15:34:31 +01:00
parent 2bfb471a20
commit f005e4a188
3 changed files with 14 additions and 6 deletions

View File

@ -28,6 +28,7 @@ GIF_ANIM_FILE = os.path.join(IMAGES, "cogs.gif")
DICOM_FILE = os.path.join(IMAGES, "dicom_test_image.dcm")
BMP_FILE = os.path.join(IMAGES, "MARBLES.BMP")
NIFTI_FILE = os.path.join(IMAGES, "avg152T1_LR_nifti.nii.gz")
ICO_FILE = os.path.join(IMAGES, "favicon.ico")
unsigned_formats = [pyvips.BandFormat.UCHAR,
pyvips.BandFormat.USHORT,

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -10,7 +10,7 @@ from helpers import \
JPEG_FILE, SRGB_FILE, MATLAB_FILE, PNG_FILE, TIF_FILE, OME_FILE, \
ANALYZE_FILE, GIF_FILE, WEBP_FILE, EXR_FILE, FITS_FILE, OPENSLIDE_FILE, \
PDF_FILE, SVG_FILE, SVGZ_FILE, SVG_GZ_FILE, GIF_ANIM_FILE, DICOM_FILE, \
BMP_FILE, NIFTI_FILE, \
BMP_FILE, NIFTI_FILE, ICO_FILE, \
temp_filename, assert_almost_equal_objects, have, skip_if_no
@ -428,12 +428,19 @@ class TestForeign:
# assert im.bands == 1
# added in 8.7
if have("magicksave"):
self.save_load_file(".bmp", "", self.colour, 0)
self.save_load_buffer("magicksave_buffer", "magickload_buffer",
self.colour, 0, format="BMP")
self.save_load("%s.bmp", self.colour)
# libvips has its own sniffer for ICO, test that
with open(ICO_FILE, 'rb') as f:
buf = f.read()
im = pyvips.Image.new_from_buffer(buf, "")
assert im.width == 16
assert im.height == 16
@skip_if_no("webpload")
def test_webp(self):
def webp_valid(im):