pillow-avif-plugin 1.4.3__cp311-cp311-musllinux_1_1_x86_64.whl → 1.4.5__cp311-cp311-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.

@@ -16,6 +16,7 @@ except ImportError:
16
16
  # to Image.open (see https://github.com/python-pillow/Pillow/issues/569)
17
17
  DECODE_CODEC_CHOICE = "auto"
18
18
  CHROMA_UPSAMPLING = "auto"
19
+ DEFAULT_MAX_THREADS = 0
19
20
 
20
21
  _VALID_AVIF_MODES = {"RGB", "RGBA"}
21
22
 
@@ -61,7 +62,7 @@ class AvifImageFile(ImageFile.ImageFile):
61
62
 
62
63
  def _open(self):
63
64
  self._decoder = _avif.AvifDecoder(
64
- self.fp.read(), DECODE_CODEC_CHOICE, CHROMA_UPSAMPLING
65
+ self.fp.read(), DECODE_CODEC_CHOICE, CHROMA_UPSAMPLING, DEFAULT_MAX_THREADS
65
66
  )
66
67
 
67
68
  # Get info from decoder
@@ -138,6 +139,7 @@ def _save(im, fp, filename, save_all=False):
138
139
  duration = info.get("duration", 0)
139
140
  subsampling = info.get("subsampling", "4:2:0")
140
141
  speed = info.get("speed", 6)
142
+ max_threads = info.get("max_threads", DEFAULT_MAX_THREADS)
141
143
  codec = info.get("codec", "auto")
142
144
  range_ = info.get("range", "full")
143
145
  tile_rows_log2 = info.get("tile_rows", 0)
@@ -196,6 +198,7 @@ def _save(im, fp, filename, save_all=False):
196
198
  qmax,
197
199
  quality,
198
200
  speed,
201
+ max_threads,
199
202
  codec,
200
203
  range_,
201
204
  tile_rows_log2,
@@ -230,6 +233,10 @@ def _save(im, fp, filename, save_all=False):
230
233
  "A" in ims.mode
231
234
  or "a" in ims.mode
232
235
  or (ims.mode == "P" and "A" in ims.im.getpalettemode())
236
+ or (
237
+ ims.mode == "P"
238
+ and ims.info.get("transparency", None) is not None
239
+ )
233
240
  )
234
241
  rawmode = "RGBA" if alpha else "RGB"
235
242
  frame = ims.convert(rawmode)
pillow_avif/__init__.py CHANGED
@@ -2,4 +2,4 @@ from . import AvifImagePlugin
2
2
 
3
3
 
4
4
  __all__ = ["AvifImagePlugin"]
5
- __version__ = "1.4.3"
5
+ __version__ = "1.4.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pillow-avif-plugin
3
- Version: 1.4.3
3
+ Version: 1.4.5
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/__init__.py,sha256=neK8L9UdgfiNWjwVYhzWdD5m6wL80awwVELprQkPGkI,84
2
+ pillow_avif/_avif.cpython-311-x86_64-linux-musl.so,sha256=PM08naNW0SwHZC7Mh4mzTwBz2KHhSqoYxPdMsX15B5M,21444929
3
+ pillow_avif/AvifImagePlugin.py,sha256=MfIVDuN7jVDceVl68b9R5lTHxzrHG6wpt6Ca-NbFdAw,8486
4
+ pillow_avif_plugin.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257
5
+ pillow_avif_plugin-1.4.5.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
6
+ pillow_avif_plugin-1.4.5.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
+ pillow_avif_plugin-1.4.5.dist-info/WHEEL,sha256=jjDQaigtQlPF6ErB4w9rlStG8xt3kaHNW9IM-TiCBWw,112
8
+ pillow_avif_plugin-1.4.5.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
9
+ pillow_avif_plugin-1.4.5.dist-info/RECORD,,
10
+ pillow_avif_plugin-1.4.5.dist-info/METADATA,sha256=rK3aQIk86onqHysupKB2eK7FE8vmaKnXevt7n84NElQ,1668
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-musllinux_1_1_x86_64
5
5
 
@@ -1,10 +0,0 @@
1
- pillow_avif/_avif.cpython-311-x86_64-linux-musl.so,sha256=q430lg2_aDrWzCF2KnkhuAjtjILGn_zgv9dZvgOJuSw,21731505
2
- pillow_avif/AvifImagePlugin.py,sha256=se4JpJUjAnnmMBGse2O_YaggpPrvHRdcTg_TGQsCAg4,8179
3
- pillow_avif/__init__.py,sha256=-Z2ywZ6XLH8v9vdgtEGintI8X4XK-pDp1OcwsHGgN-o,84
4
- pillow_avif_plugin-1.4.3.dist-info/WHEEL,sha256=kZbRYzJAsbn-375Ezg3sFxyeLTG4jUZSOoAE6n04NjE,113
5
- pillow_avif_plugin-1.4.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
- pillow_avif_plugin-1.4.3.dist-info/top_level.txt,sha256=xrg4zRnqDyl_JEyEQh3oCcAU4BHneocD-DCFDzf4g9E,12
7
- pillow_avif_plugin-1.4.3.dist-info/RECORD,,
8
- pillow_avif_plugin-1.4.3.dist-info/LICENSE,sha256=2l49eVdgaNy9JTEPbstz1GaaPKw02gFdtuThTNUi730,25213
9
- pillow_avif_plugin-1.4.3.dist-info/METADATA,sha256=sX5puKluXw1ivDH8yx4GZ-nnE67sM6EJrhwLvTAE9uU,1668
10
- pillow_avif_plugin.libs/libgcc_s-a04fdf82.so.1,sha256=YxqJNaesQMhDswHEQpXsiLnVvMBBbYO6KYMDZFPWKSM,81257