pillow-avif-plugin 1.3.1__cp37-cp37m-macosx_11_0_arm64.whl → 1.4.1__cp37-cp37m-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.
- pillow_avif/AvifImagePlugin.py +10 -19
- pillow_avif/__init__.py +1 -1
- pillow_avif/_avif.cpython-37m-darwin.so +0 -0
- {pillow_avif_plugin-1.3.1.dist-info → pillow_avif_plugin-1.4.1.dist-info}/METADATA +2 -1
- pillow_avif_plugin-1.4.1.dist-info/RECORD +9 -0
- {pillow_avif_plugin-1.3.1.dist-info → pillow_avif_plugin-1.4.1.dist-info}/WHEEL +1 -1
- pillow_avif/.dylibs/libavif.15.0.0.dylib +0 -0
- pillow_avif_plugin-1.3.1.dist-info/RECORD +0 -10
- {pillow_avif_plugin-1.3.1.dist-info → pillow_avif_plugin-1.4.1.dist-info}/LICENSE +0 -0
- {pillow_avif_plugin-1.3.1.dist-info → pillow_avif_plugin-1.4.1.dist-info}/top_level.txt +0 -0
- {pillow_avif_plugin-1.3.1.dist-info → pillow_avif_plugin-1.4.1.dist-info}/zip-safe +0 -0
pillow_avif/AvifImagePlugin.py
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
@@ -124,23 +126,11 @@ def _save(im, fp, filename, save_all=False):
|
|
|
124
126
|
|
|
125
127
|
is_single_frame = total == 1
|
|
126
128
|
|
|
127
|
-
qmin = info.get("qmin")
|
|
128
|
-
qmax = info.get("qmax")
|
|
129
|
-
|
|
130
|
-
if
|
|
131
|
-
|
|
132
|
-
# to 63 (worst quality). If neither are explicitly specified, we use a 0-100
|
|
133
|
-
# quality scale (default 75) and calculate the qmin and qmax from that.
|
|
134
|
-
#
|
|
135
|
-
# - qmin is 0 for quality >= 64. Below that, qmin has an inverse linear
|
|
136
|
-
# relation to quality (i.e., quality 63 = qmin 1, quality 0 => qmin 63)
|
|
137
|
-
# - qmax is 0 for quality=100, then qmax increases linearly relative to
|
|
138
|
-
# quality decreasing, until it flattens out at quality=37.
|
|
139
|
-
quality = info.get("quality", 75)
|
|
140
|
-
if not isinstance(quality, int):
|
|
141
|
-
raise ValueError("Invalid quality setting")
|
|
142
|
-
qmin = max(0, min(64 - quality, 63))
|
|
143
|
-
qmax = max(0, min(100 - quality, 63))
|
|
129
|
+
qmin = info.get("qmin", -1)
|
|
130
|
+
qmax = info.get("qmax", -1)
|
|
131
|
+
quality = info.get("quality", 75)
|
|
132
|
+
if not isinstance(quality, int) or quality < 0 or quality > 100:
|
|
133
|
+
raise ValueError("Invalid quality setting")
|
|
144
134
|
|
|
145
135
|
duration = info.get("duration", 0)
|
|
146
136
|
subsampling = info.get("subsampling", "4:2:0")
|
|
@@ -187,6 +177,7 @@ def _save(im, fp, filename, save_all=False):
|
|
|
187
177
|
subsampling,
|
|
188
178
|
qmin,
|
|
189
179
|
qmax,
|
|
180
|
+
quality,
|
|
190
181
|
speed,
|
|
191
182
|
codec,
|
|
192
183
|
range_,
|
pillow_avif/__init__.py
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pillow-avif-plugin
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
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=-tzGuNK05MzVqJeqJ9sglLXp4Btg6AwX396luIAhUzs,7730
|
|
2
|
+
pillow_avif/__init__.py,sha256=TMNAyGWthW-dGYbEluqxCn3tNMeJF3q7-nkIZXpYoEw,84
|
|
3
|
+
pillow_avif/_avif.cpython-37m-darwin.so,sha256=86kbArp5JQ3RWpfLk7Lk8V2Z_QF0qxWDNAnHNgf9kuc,11831656
|
|
4
|
+
pillow_avif_plugin-1.4.1.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
|
|
5
|
+
pillow_avif_plugin-1.4.1.dist-info/METADATA,sha256=riGgqc74ZQc3YPuOgqFiNQ_O3wDFhBRjnPq4reKLxa0,1668
|
|
6
|
+
pillow_avif_plugin-1.4.1.dist-info/WHEEL,sha256=OpgwcRZuIq86N8PNaymr9AxpuMy4EBT105MNpTrXC_U,109
|
|
7
|
+
pillow_avif_plugin-1.4.1.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
|
|
8
|
+
pillow_avif_plugin-1.4.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
9
|
+
pillow_avif_plugin-1.4.1.dist-info/RECORD,,
|
|
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=P9Q66WANSepj6IpJIe6dJDn-3xxJ0dTqEFWxH1slCsI,109
|
|
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/__init__.py,sha256=Adpn2vcvDdfDj2QJR9_c_pmdzVif_ZeYeWZRAZknk8w,84
|
|
9
|
-
pillow_avif/_avif.cpython-37m-darwin.so,sha256=Q8z0Fpylvz1xozB01pOcr6HKBawGauLwiw-3WricyS4,74752
|
|
10
|
-
pillow_avif/.dylibs/libavif.15.0.0.dylib,sha256=8pnxETs8S8Gbg2wr30D-Q5KlP-7qQbGvEBP5mRIGQd4,13514592
|
|
File without changes
|
|
File without changes
|
|
File without changes
|