pillow-avif-plugin 1.4.1__cp312-cp312-musllinux_1_1_x86_64.whl → 1.4.2__cp312-cp312-musllinux_1_1_x86_64.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 +19 -1
- pillow_avif/__init__.py +1 -1
- pillow_avif/_avif.cpython-312-x86_64-linux-musl.so +0 -0
- {pillow_avif_plugin-1.4.1.dist-info → pillow_avif_plugin-1.4.2.dist-info}/METADATA +1 -1
- pillow_avif_plugin-1.4.2.dist-info/RECORD +10 -0
- {pillow_avif_plugin-1.4.1.dist-info → pillow_avif_plugin-1.4.2.dist-info}/WHEEL +1 -1
- pillow_avif_plugin-1.4.1.dist-info/RECORD +0 -10
- {pillow_avif_plugin-1.4.1.dist-info → pillow_avif_plugin-1.4.2.dist-info}/LICENSE +0 -0
- {pillow_avif_plugin-1.4.1.dist-info → pillow_avif_plugin-1.4.2.dist-info}/top_level.txt +0 -0
- {pillow_avif_plugin-1.4.1.dist-info → pillow_avif_plugin-1.4.2.dist-info}/zip-safe +0 -0
pillow_avif/AvifImagePlugin.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import division
|
|
|
3
3
|
from io import BytesIO
|
|
4
4
|
import sys
|
|
5
5
|
|
|
6
|
-
from PIL import Image, ImageFile
|
|
6
|
+
from PIL import ExifTags, Image, ImageFile
|
|
7
7
|
|
|
8
8
|
try:
|
|
9
9
|
from pillow_avif import _avif
|
|
@@ -56,6 +56,9 @@ class AvifImageFile(ImageFile.ImageFile):
|
|
|
56
56
|
__loaded = -1
|
|
57
57
|
__frame = 0
|
|
58
58
|
|
|
59
|
+
def load_seek(self, pos):
|
|
60
|
+
pass
|
|
61
|
+
|
|
59
62
|
def _open(self):
|
|
60
63
|
self._decoder = _avif.AvifDecoder(
|
|
61
64
|
self.fp.read(), DECODE_CODEC_CHOICE, CHROMA_UPSAMPLING
|
|
@@ -146,6 +149,20 @@ def _save(im, fp, filename, save_all=False):
|
|
|
146
149
|
exif = info.get("exif", im.info.get("exif"))
|
|
147
150
|
if isinstance(exif, Image.Exif):
|
|
148
151
|
exif = exif.tobytes()
|
|
152
|
+
|
|
153
|
+
exif_orientation = 0
|
|
154
|
+
if exif:
|
|
155
|
+
exif_data = Image.Exif()
|
|
156
|
+
try:
|
|
157
|
+
exif_data.load(exif)
|
|
158
|
+
except SyntaxError:
|
|
159
|
+
pass
|
|
160
|
+
else:
|
|
161
|
+
orientation_tag = next(
|
|
162
|
+
k for k, v in ExifTags.TAGS.items() if v == "Orientation"
|
|
163
|
+
)
|
|
164
|
+
exif_orientation = exif_data.get(orientation_tag) or 0
|
|
165
|
+
|
|
149
166
|
xmp = info.get("xmp", im.info.get("xmp") or im.info.get("XML:com.adobe.xmp"))
|
|
150
167
|
|
|
151
168
|
if isinstance(xmp, text_type):
|
|
@@ -187,6 +204,7 @@ def _save(im, fp, filename, save_all=False):
|
|
|
187
204
|
autotiling,
|
|
188
205
|
icc_profile or b"",
|
|
189
206
|
exif or b"",
|
|
207
|
+
exif_orientation,
|
|
190
208
|
xmp or b"",
|
|
191
209
|
advanced,
|
|
192
210
|
)
|
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.4.
|
|
3
|
+
Version: 1.4.2
|
|
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
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pillow_avif_plugin-1.4.2.dist-info/WHEEL,sha256=_HcQ2b7A7kmoL07OrmlfslTmjrPbYdrUU_3YEedvR-E,113
|
|
2
|
+
pillow_avif_plugin-1.4.2.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
|
|
3
|
+
pillow_avif_plugin-1.4.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
4
|
+
pillow_avif_plugin-1.4.2.dist-info/RECORD,,
|
|
5
|
+
pillow_avif_plugin-1.4.2.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
|
|
6
|
+
pillow_avif_plugin-1.4.2.dist-info/METADATA,sha256=G7VYS-n_7MVgMI_3pzslXCd-ZW8fI2weKDxlVxKzYmk,1668
|
|
7
|
+
pillow_avif_plugin.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257
|
|
8
|
+
pillow_avif/AvifImagePlugin.py,sha256=se4JpJUjAnnmMBGse2O_YaggpPrvHRdcTg_TGQsCAg4,8179
|
|
9
|
+
pillow_avif/_avif.cpython-312-x86_64-linux-musl.so,sha256=3OgEutJ1nB0XqsYI7p7MtX6fqHQgTwIXwdee1v91DHg,21722953
|
|
10
|
+
pillow_avif/__init__.py,sha256=f6QUykmiiEKOe3vqwVOGduagE9zCf89g75i_ajHVULE,84
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
pillow_avif/_avif.cpython-312-x86_64-linux-musl.so,sha256=5puXHKz1zJnCprVCHBAf8K4U_tyN76IPHym-QM5mTLs,21722953
|
|
2
|
-
pillow_avif/AvifImagePlugin.py,sha256=-tzGuNK05MzVqJeqJ9sglLXp4Btg6AwX396luIAhUzs,7730
|
|
3
|
-
pillow_avif/__init__.py,sha256=TMNAyGWthW-dGYbEluqxCn3tNMeJF3q7-nkIZXpYoEw,84
|
|
4
|
-
pillow_avif_plugin.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257
|
|
5
|
-
pillow_avif_plugin-1.4.1.dist-info/METADATA,sha256=riGgqc74ZQc3YPuOgqFiNQ_O3wDFhBRjnPq4reKLxa0,1668
|
|
6
|
-
pillow_avif_plugin-1.4.1.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
|
|
7
|
-
pillow_avif_plugin-1.4.1.dist-info/WHEEL,sha256=uT-xhH87qjQ2hSw9lVd8vIm9vhYqN6sN2YUST8TBLck,113
|
|
8
|
-
pillow_avif_plugin-1.4.1.dist-info/RECORD,,
|
|
9
|
-
pillow_avif_plugin-1.4.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
10
|
-
pillow_avif_plugin-1.4.1.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
|
|
File without changes
|
|
File without changes
|
|
File without changes
|