2021-01-13 11:07:50 +00:00
|
|
|
from pyodide_build.testing import run_in_pyodide
|
2020-12-24 07:26:26 +00:00
|
|
|
|
2021-01-13 11:07:50 +00:00
|
|
|
|
|
|
|
@run_in_pyodide(standalone=True, packages=["numpy", "imageio"])
|
|
|
|
def test_imageio():
|
|
|
|
import numpy as np
|
|
|
|
import imageio
|
|
|
|
|
|
|
|
filename = "/tmp/foo.tif"
|
|
|
|
image_in = np.random.randint(0, 65535, size=(100, 36), dtype=np.uint16)
|
|
|
|
imageio.imwrite(filename, image_in)
|
|
|
|
image_out = imageio.imread(filename)
|
|
|
|
assert image_out.shape == (100, 36)
|
|
|
|
np.testing.assert_equal(image_in, image_out)
|