numpyimage 3.8.2__tar.gz → 3.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {numpyimage-3.8.2 → numpyimage-3.10.0}/PKG-INFO +1 -1
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/imageio.py +8 -4
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/vidio.py +615 -71
- {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/PKG-INFO +1 -1
- {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/SOURCES.txt +1 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/pyproject.toml +1 -1
- numpyimage-3.10.0/tests/test_orientation.py +51 -0
- numpyimage-3.10.0/tests/test_video_streamer.py +794 -0
- numpyimage-3.8.2/tests/test_video_streamer.py +0 -322
- {numpyimage-3.8.2 → numpyimage-3.10.0}/LICENSE +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/README.md +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/__init__.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/align.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/graphics.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/nrrd_utils.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/operations.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/utils.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/dependency_links.txt +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/requires.txt +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/top_level.txt +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/setup.cfg +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_heic.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_pbm.py +0 -0
- {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_video_writers.py +0 -0
|
@@ -52,13 +52,17 @@ def load(filename, dim_order='zyx', **kwargs) -> Union[np.ndarray, Tuple[np.ndar
|
|
|
52
52
|
metadata = None
|
|
53
53
|
|
|
54
54
|
if extension in ['jpg', 'jpeg', 'png']:
|
|
55
|
-
from PIL import Image
|
|
56
|
-
|
|
55
|
+
from PIL import Image, ImageOps
|
|
56
|
+
# PIL.Image.open returns the raw stored pixels and does not apply the
|
|
57
|
+
# EXIF Orientation tag, so photos taken in a rotated orientation would
|
|
58
|
+
# load sideways or upside-down. ImageOps.exif_transpose applies the tag
|
|
59
|
+
# (and is a no-op when no Orientation tag is present).
|
|
60
|
+
data = np.array(ImageOps.exif_transpose(Image.open(filename)))
|
|
57
61
|
|
|
58
62
|
if extension == 'heic':
|
|
59
63
|
_ensure_heif_opener_registered()
|
|
60
|
-
from PIL import Image
|
|
61
|
-
data = np.array(Image.open(filename))
|
|
64
|
+
from PIL import Image, ImageOps
|
|
65
|
+
data = np.array(ImageOps.exif_transpose(Image.open(filename)))
|
|
62
66
|
|
|
63
67
|
if extension in ['tif', 'tiff']:
|
|
64
68
|
import tifffile
|