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.
Files changed (24) hide show
  1. {numpyimage-3.8.2 → numpyimage-3.10.0}/PKG-INFO +1 -1
  2. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/imageio.py +8 -4
  3. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/vidio.py +615 -71
  4. {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/PKG-INFO +1 -1
  5. {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/SOURCES.txt +1 -0
  6. {numpyimage-3.8.2 → numpyimage-3.10.0}/pyproject.toml +1 -1
  7. numpyimage-3.10.0/tests/test_orientation.py +51 -0
  8. numpyimage-3.10.0/tests/test_video_streamer.py +794 -0
  9. numpyimage-3.8.2/tests/test_video_streamer.py +0 -322
  10. {numpyimage-3.8.2 → numpyimage-3.10.0}/LICENSE +0 -0
  11. {numpyimage-3.8.2 → numpyimage-3.10.0}/README.md +0 -0
  12. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/__init__.py +0 -0
  13. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/align.py +0 -0
  14. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/graphics.py +0 -0
  15. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/nrrd_utils.py +0 -0
  16. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/operations.py +0 -0
  17. {numpyimage-3.8.2 → numpyimage-3.10.0}/npimage/utils.py +0 -0
  18. {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/dependency_links.txt +0 -0
  19. {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/requires.txt +0 -0
  20. {numpyimage-3.8.2 → numpyimage-3.10.0}/numpyimage.egg-info/top_level.txt +0 -0
  21. {numpyimage-3.8.2 → numpyimage-3.10.0}/setup.cfg +0 -0
  22. {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_heic.py +0 -0
  23. {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_pbm.py +0 -0
  24. {numpyimage-3.8.2 → numpyimage-3.10.0}/tests/test_video_writers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpyimage
3
- Version: 3.8.2
3
+ Version: 3.10.0
4
4
  Summary: Load, save, & manipulate image files as numpy arrays
5
5
  Author-email: Jasper Phelps <jasper.s.phelps@gmail.com>
6
6
  License: MIT License
@@ -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
- data = np.array(Image.open(filename)) # PIL.Image.open returns zyx order
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)) # PIL.Image.open returns zyx order
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