Commit 5294849c authored by André Anjos's avatar André Anjos 💬
Browse files

Add test for non-contiguous image saving

parent df5fffd3
Pipeline #3760 passed with stages
in 49 minutes and 24 seconds
......@@ -62,6 +62,7 @@ def test_png_gray_alpha():
def transcode(filename):
tmpname = test_utils.temporary_filename(suffix=os.path.splitext(filename)[1])
tmpnam_ = test_utils.temporary_filename(suffix=os.path.splitext(filename)[1])
# complete transcoding test
......@@ -75,9 +76,22 @@ def transcode(filename):
assert numpy.array_equal(image, image2)
# test getting part of the image as well
if len(image.shape) == 3:
subsample = image[:,::2,::2]
subsample = image[::2,::2]
assert not subsample.flags.contiguous
write(subsample, tmpnam_)
image3 = load(tmpnam_)
assert numpy.array_equal(subsample, image3)
if os.path.exists(tmpname):
if os.path.exists(tmpnam_):
def test_netpbm():
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment