pillow-avif-plugin 1.3.1__cp39-cp39-macosx_11_0_arm64.whl → 1.4.0__cp39-cp39-macosx_11_0_arm64.whl

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.

Potentially problematic release.


This version of pillow-avif-plugin might be problematic. Click here for more details.

@@ -51,7 +51,6 @@ def _accept(prefix):
51
51
 
52
52
 
53
53
  class AvifImageFile(ImageFile.ImageFile):
54
-
55
54
  format = "AVIF"
56
55
  format_description = "AVIF image"
57
56
  __loaded = -1
@@ -67,7 +66,10 @@ class AvifImageFile(ImageFile.ImageFile):
67
66
  self._size = width, height
68
67
  self.n_frames = n_frames
69
68
  self.is_animated = self.n_frames > 1
70
- self.mode = self.rawmode = mode
69
+ try:
70
+ self.mode = self.rawmode = mode
71
+ except AttributeError:
72
+ self._mode = self.rawmode = mode
71
73
  self.tile = []
72
74
 
73
75
  if icc:
@@ -137,7 +139,7 @@ def _save(im, fp, filename, save_all=False):
137
139
  # - qmax is 0 for quality=100, then qmax increases linearly relative to
138
140
  # quality decreasing, until it flattens out at quality=37.
139
141
  quality = info.get("quality", 75)
140
- if not isinstance(quality, int):
142
+ if not isinstance(quality, int) or quality < 0 or quality > 100:
141
143
  raise ValueError("Invalid quality setting")
142
144
  qmin = max(0, min(64 - quality, 63))
143
145
  qmax = max(0, min(100 - quality, 63))
@@ -187,6 +189,7 @@ def _save(im, fp, filename, save_all=False):
187
189
  subsampling,
188
190
  qmin,
189
191
  qmax,
192
+ quality,
190
193
  speed,
191
194
  codec,
192
195
  range_,
pillow_avif/__init__.py CHANGED
@@ -2,4 +2,4 @@ from . import AvifImagePlugin
2
2
 
3
3
 
4
4
  __all__ = ["AvifImagePlugin"]
5
- __version__ = "1.3.1"
5
+ __version__ = "1.4.0"
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pillow-avif-plugin
3
- Version: 1.3.1
3
+ Version: 1.4.0
4
4
  Summary: A pillow plugin that adds avif support via libavif
5
5
  Home-page: https://github.com/fdintino/pillow-avif-plugin/
6
6
  Download-URL: https://github.com/fdintino/pillow-avif-plugin/releases
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.8
21
21
  Classifier: Programming Language :: Python :: 3.9
22
22
  Classifier: Programming Language :: Python :: 3.10
23
23
  Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
24
25
  Classifier: Programming Language :: Python :: Implementation :: CPython
25
26
  Classifier: Programming Language :: Python :: Implementation :: PyPy
26
27
  Classifier: Topic :: Multimedia :: Graphics
@@ -0,0 +1,9 @@
1
+ pillow_avif/AvifImagePlugin.py,sha256=GeBGlSqlc7BxefTzMKK-YRTJcvo7GeE68jqDdraUnkA,8434
2
+ pillow_avif/__init__.py,sha256=KOvHpXQefN5SKRheYSTMIbRHWVvp6ClvnfT0cjDmL5M,84
3
+ pillow_avif/_avif.cpython-39-darwin.so,sha256=Nk9WPZU_5JQQIE6Lj6HrsEc4ccxDWJKmfotH9DtLHfY,11831719
4
+ pillow_avif_plugin-1.4.0.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
5
+ pillow_avif_plugin-1.4.0.dist-info/METADATA,sha256=-t1rfG3DAYJqocic2KMehZij-n-6_S1PUozPJvLJ6t4,1668
6
+ pillow_avif_plugin-1.4.0.dist-info/WHEEL,sha256=RXcaVXR1VzLQNykyQkOwdYMhFRpSIriy9vgf0qPtPa0,108
7
+ pillow_avif_plugin-1.4.0.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
8
+ pillow_avif_plugin-1.4.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
9
+ pillow_avif_plugin-1.4.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-macosx_11_0_arm64
5
5
 
Binary file
@@ -1,10 +0,0 @@
1
- pillow_avif_plugin-1.3.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
- pillow_avif_plugin-1.3.1.dist-info/RECORD,,
3
- pillow_avif_plugin-1.3.1.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
4
- pillow_avif_plugin-1.3.1.dist-info/WHEEL,sha256=oITnL8r4K9lhj-wWSHlE2XUA0J8WLXdegrKtvi_34zA,108
5
- pillow_avif_plugin-1.3.1.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
6
- pillow_avif_plugin-1.3.1.dist-info/METADATA,sha256=rTTRsjx3PeNzanfCNxgqX0-GsXxmz87RKGnpjgxpJR0,1617
7
- pillow_avif/AvifImagePlugin.py,sha256=EbBJ8d3-qRtsgSmOpDWvSmmcUN2s3kd1FjTpWNXUfqU,8293
8
- pillow_avif/_avif.cpython-39-darwin.so,sha256=uKT3FRvxNj-RUGq0G4eqL_4cQ1lPLKRmU7OPETYEUpE,74800
9
- pillow_avif/__init__.py,sha256=Adpn2vcvDdfDj2QJR9_c_pmdzVif_ZeYeWZRAZknk8w,84
10
- pillow_avif/.dylibs/libavif.15.0.0.dylib,sha256=8pnxETs8S8Gbg2wr30D-Q5KlP-7qQbGvEBP5mRIGQd4,13514592