PKG Add imageio (#919)

This commit is contained in:
Wei Ouyang 2020-12-24 08:26:26 +01:00 committed by GitHub
parent bb604b367c
commit bcc3996a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 2 deletions

View File

@ -20,7 +20,7 @@
[#846](https://github.com/iodide-project/pyodide/pull/846)
- Updated to emscripten 1.38.34
[#480](https://github.com/iodide-project/pyodide/pull/480)
- New packages: freesasa, lxml, python-sat, traits, astropy, pillow
- New packages: freesasa, lxml, python-sat, traits, astropy, pillow, scikit-image, imageio
- Updated packages: numpy 1.15.4, pandas 1.0.5, matplotlib 3.3.3 among others.
- Updated default `--ldflags` argument to `pyodide_build` scripts to equal what
pyodide actually uses.

View File

@ -0,0 +1,14 @@
package:
name: imageio
version: 2.9.0
source:
sha256: 52ddbaeca2dccf53ba2d6dec5676ca7bc3b2403ef8b37f7da78b7654bb3e10f0
url: https://files.pythonhosted.org/packages/c3/73/f37f428748c4f10a7991ac5bff00f113a34bcc0d0a78957d6e1cdc29a94e/imageio-2.9.0.tar.gz
patches:
- patches/setitup.patch
requirements:
run:
- numpy
test:
imports:
- imageio

View File

@ -0,0 +1,35 @@
diff --git a/imageio/core/findlib.py b/imageio/core/findlib.py
--- a/imageio/core/findlib.py
+++ b/imageio/core/findlib.py
@@ -7,7 +7,6 @@
import os
import sys
-import ctypes
LOCALDIR = os.path.abspath(os.path.dirname(__file__))
@@ -95,6 +94,7 @@ def load_lib(exact_lib_names, lib_names, lib_dirs=None):
Returns ``(ctypes_library, library_path)``
"""
+ import ctypes
# Checks
assert isinstance(exact_lib_names, list)
diff --git a/imageio/plugins/__init__.py b/imageio/plugins/__init__.py
index 7e26683..971f83e 100644
--- a/imageio/plugins/__init__.py
+++ b/imageio/plugins/__init__.py
@@ -84,8 +84,8 @@ from . import tifffile
from . import pillow
from . import grab
-from . import freeimage
-from . import freeimagemulti
+# from . import freeimage
+# from . import freeimagemulti
from . import ffmpeg

View File

@ -0,0 +1,15 @@
def test_imageio(selenium):
selenium.load_package(["numpy", "imageio"])
selenium.run(
r"""
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)
"""
)

View File

@ -15,6 +15,7 @@ requirements:
- matplotlib
- networkx
- pillow
- imageio
- pywavelets
test:
imports:

View File

@ -5,7 +5,7 @@
preferred_plugins = {
# Default plugins for all types (overridden by specific types below).
- 'all': ['imageio', 'pil', 'matplotlib', 'qt'],
+ 'all': ['pil', 'matplotlib'],
+ 'all': ['imageio', 'pil', 'matplotlib'],
'imshow': ['matplotlib'],
'imshow_collection': ['matplotlib']
}