numpyimage 2.8.0__tar.gz → 2.9.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpyimage
3
- Version: 2.8.0
3
+ Version: 2.9.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: GNU GENERAL PUBLIC LICENSE
@@ -439,6 +439,8 @@ class VideoWriter:
439
439
  self.stream.height = 0
440
440
 
441
441
  def write(self, frame):
442
+ if self._closed:
443
+ raise RuntimeError('VideoWriter is closed, cannot write more frames.')
442
444
  if not isinstance(frame, self.av.VideoFrame):
443
445
  if not isinstance(frame, np.ndarray):
444
446
  frame = np.array(frame)
@@ -468,6 +470,9 @@ class VideoWriter:
468
470
  return self
469
471
 
470
472
  def __exit__(self, exc_type, exc_val, exc_tb):
473
+ self.close()
474
+
475
+ def close(self):
471
476
  # Flush stream
472
477
  for packet in self.stream.encode():
473
478
  self.container.mux(packet)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpyimage
3
- Version: 2.8.0
3
+ Version: 2.9.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: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'numpyimage'
7
- version = '2.8.0'
7
+ version = '2.9.0'
8
8
  description = 'Load, save, & manipulate image files as numpy arrays'
9
9
  readme.file = 'README.md'
10
10
  readme.content-type = 'text/markdown'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes