Merge branch 'main' into grabclipboard-linux

This commit is contained in:
Andrew Murray 2023-08-21 23:58:17 +10:00
commit 8b14a67347
7 changed files with 20 additions and 17 deletions

View File

@ -5,6 +5,9 @@ Changelog (Pillow)
10.1.0 (unreleased)
-------------------
- Read WebP duration after opening #7311
[k128, radarhere]
- Allow "loop=None" when saving GIF images #7329
[radarhere]

View File

@ -79,7 +79,7 @@ class TestFilePng:
def test_sanity(self, tmp_path):
# internal version number
assert re.search(r"\d+\.\d+\.\d+(\.\d+)?$", features.version_codec("zlib"))
assert re.search(r"\d+(\.\d+){1,3}$", features.version_codec("zlib"))
test_file = str(tmp_path / "temp.png")

View File

@ -233,5 +233,4 @@ class TestFileWebp:
im.save(out_webp, save_all=True)
with Image.open(out_webp) as reloaded:
reloaded.load()
assert reloaded.info["duration"] == 1000

View File

@ -83,10 +83,9 @@ Install Pillow with :command:`pip`::
.. tab:: Windows
We provide Pillow binaries for Windows compiled for the matrix of
supported Pythons in both 32 and 64-bit versions in the wheel format.
These binaries include support for all optional libraries except
libimagequant and libxcb. Raqm support requires
FriBiDi to be installed separately::
supported Pythons in 64-bit versions in the wheel format. These binaries include
support for all optional libraries except libimagequant and libxcb. Raqm support
requires FriBiDi to be installed separately::
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

View File

@ -206,4 +206,4 @@ Support reading signed 8-bit TIFF images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TIFF images with signed integer data, 8 bits per sample and a photometric
interpretaton of BlackIsZero can now be read.
interpretation of BlackIsZero can now be read.

View File

@ -74,6 +74,9 @@ class WebPImageFile(ImageFile.ImageFile):
self.info["background"] = (bg_r, bg_g, bg_b, bg_a)
self.n_frames = frame_count
self.is_animated = self.n_frames > 1
ret = self._decoder.get_next()
if ret is not None:
self.info["duration"] = ret[1]
self._mode = "RGB" if mode == "RGBX" else mode
self.rawmode = mode
self.tile = []
@ -90,7 +93,7 @@ class WebPImageFile(ImageFile.ImageFile):
self.info["xmp"] = xmp
# Initialize seek state
self._reset(reset=False)
self._reset()
def _getexif(self):
if "exif" not in self.info:
@ -113,9 +116,8 @@ class WebPImageFile(ImageFile.ImageFile):
# Set logical frame to requested position
self.__logical_frame = frame
def _reset(self, reset=True):
if reset:
self._decoder.reset()
def _reset(self):
self._decoder.reset()
self.__physical_frame = 0
self.__loaded = -1
self.__timestamp = 0

View File

@ -130,9 +130,9 @@ deps = {
"bins": ["cjpeg.exe", "djpeg.exe"],
},
"zlib": {
"url": "https://zlib.net/zlib1213.zip",
"filename": "zlib1213.zip",
"dir": "zlib-1.2.13",
"url": "https://zlib.net/zlib13.zip",
"filename": "zlib13.zip",
"dir": "zlib-1.3",
"license": "README",
"license_pattern": "Copyright notice:\n\n(.+)$",
"build": [
@ -335,9 +335,9 @@ deps = {
"libs": [r"imagequant.lib"],
},
"harfbuzz": {
"url": "https://github.com/harfbuzz/harfbuzz/archive/8.0.0.zip",
"filename": "harfbuzz-8.0.0.zip",
"dir": "harfbuzz-8.0.0",
"url": "https://github.com/harfbuzz/harfbuzz/archive/8.1.1.zip",
"filename": "harfbuzz-8.1.1.zip",
"dir": "harfbuzz-8.1.1",
"license": "COPYING",
"build": [
*cmds_cmake(