"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/test-suite/test_foreign.py" between
vips-8.10.4.tar.gz and vips-8.10.5.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

test_foreign.py  (vips-8.10.4):test_foreign.py  (vips-8.10.5)
skipping to change at line 20 skipping to change at line 20
from helpers import \ from helpers import \
JPEG_FILE, SRGB_FILE, MATLAB_FILE, PNG_FILE, TIF_FILE, OME_FILE, \ JPEG_FILE, SRGB_FILE, MATLAB_FILE, PNG_FILE, TIF_FILE, OME_FILE, \
ANALYZE_FILE, GIF_FILE, WEBP_FILE, EXR_FILE, FITS_FILE, OPENSLIDE_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, \ PDF_FILE, SVG_FILE, SVGZ_FILE, SVG_GZ_FILE, GIF_ANIM_FILE, DICOM_FILE, \
BMP_FILE, NIFTI_FILE, ICO_FILE, HEIC_FILE, TRUNCATED_FILE, \ BMP_FILE, NIFTI_FILE, ICO_FILE, HEIC_FILE, TRUNCATED_FILE, \
GIF_ANIM_EXPECTED_PNG_FILE, GIF_ANIM_DISPOSE_BACKGROUND_FILE, \ GIF_ANIM_EXPECTED_PNG_FILE, GIF_ANIM_DISPOSE_BACKGROUND_FILE, \
GIF_ANIM_DISPOSE_BACKGROUND_EXPECTED_PNG_FILE, \ GIF_ANIM_DISPOSE_BACKGROUND_EXPECTED_PNG_FILE, \
GIF_ANIM_DISPOSE_PREVIOUS_FILE, \ GIF_ANIM_DISPOSE_PREVIOUS_FILE, \
GIF_ANIM_DISPOSE_PREVIOUS_EXPECTED_PNG_FILE, \ GIF_ANIM_DISPOSE_PREVIOUS_EXPECTED_PNG_FILE, \
temp_filename, assert_almost_equal_objects, have, skip_if_no, \ temp_filename, assert_almost_equal_objects, have, skip_if_no, \
TIF1_FILE, TIF2_FILE, TIF4_FILE, WEBP_LOOKS_LIKE_SVG_FILE TIF1_FILE, TIF2_FILE, TIF4_FILE, WEBP_LOOKS_LIKE_SVG_FILE, \
WEBP_ANIMATED_FILE
class TestForeign: class TestForeign:
tempdir = None tempdir = None
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
cls.tempdir = tempfile.mkdtemp() cls.tempdir = tempfile.mkdtemp()
cls.colour = pyvips.Image.jpegload(JPEG_FILE) cls.colour = pyvips.Image.jpegload(JPEG_FILE)
cls.mono = cls.colour.extract_band(1).copy() cls.mono = cls.colour.extract_band(1).copy()
skipping to change at line 696 skipping to change at line 697
assert x1.height == x2.height assert x1.height == x2.height
assert x1.get("delay") == x2.get("delay") assert x1.get("delay") == x2.get("delay")
assert x1.get("page-height") == x2.get("page-height") assert x1.get("page-height") == x2.get("page-height")
assert x1.get("gif-loop") == x2.get("gif-loop") assert x1.get("gif-loop") == x2.get("gif-loop")
# WebP image that happens to contain the string "<svg" # WebP image that happens to contain the string "<svg"
if have("svgload"): if have("svgload"):
x = pyvips.Image.new_from_file(WEBP_LOOKS_LIKE_SVG_FILE) x = pyvips.Image.new_from_file(WEBP_LOOKS_LIKE_SVG_FILE)
assert x.get("vips-loader") == "webpload" assert x.get("vips-loader") == "webpload"
# Animated WebP roundtrip
x = pyvips.Image.new_from_file(WEBP_ANIMATED_FILE, n=-1)
assert x.width == 13
assert x.height == 16393
buf = x.webpsave_buffer()
@skip_if_no("analyzeload") @skip_if_no("analyzeload")
def test_analyzeload(self): def test_analyzeload(self):
def analyze_valid(im): def analyze_valid(im):
a = im(10, 10) a = im(10, 10)
assert pytest.approx(a[0]) == 3335 assert pytest.approx(a[0]) == 3335
assert im.width == 128 assert im.width == 128
assert im.height == 8064 assert im.height == 8064
assert im.bands == 1 assert im.bands == 1
self.file_loader("analyzeload", ANALYZE_FILE, analyze_valid) self.file_loader("analyzeload", ANALYZE_FILE, analyze_valid)
 End of changes. 2 change blocks. 
1 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)