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) 10.1.0 (unreleased)
------------------- -------------------
- Read WebP duration after opening #7311
[k128, radarhere]
- Allow "loop=None" when saving GIF images #7329 - Allow "loop=None" when saving GIF images #7329
[radarhere] [radarhere]

View File

@ -79,7 +79,7 @@ class TestFilePng:
def test_sanity(self, tmp_path): def test_sanity(self, tmp_path):
# internal version number # 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") test_file = str(tmp_path / "temp.png")

View File

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

View File

@ -83,10 +83,9 @@ Install Pillow with :command:`pip`::
.. tab:: Windows .. tab:: Windows
We provide Pillow binaries for Windows compiled for the matrix of We provide Pillow binaries for Windows compiled for the matrix of
supported Pythons in both 32 and 64-bit versions in the wheel format. supported Pythons in 64-bit versions in the wheel format. These binaries include
These binaries include support for all optional libraries except support for all optional libraries except libimagequant and libxcb. Raqm support
libimagequant and libxcb. Raqm support requires requires FriBiDi to be installed separately::
FriBiDi to be installed separately::
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow 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 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.info["background"] = (bg_r, bg_g, bg_b, bg_a)
self.n_frames = frame_count self.n_frames = frame_count
self.is_animated = self.n_frames > 1 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._mode = "RGB" if mode == "RGBX" else mode
self.rawmode = mode self.rawmode = mode
self.tile = [] self.tile = []
@ -90,7 +93,7 @@ class WebPImageFile(ImageFile.ImageFile):
self.info["xmp"] = xmp self.info["xmp"] = xmp
# Initialize seek state # Initialize seek state
self._reset(reset=False) self._reset()
def _getexif(self): def _getexif(self):
if "exif" not in self.info: if "exif" not in self.info:
@ -113,8 +116,7 @@ class WebPImageFile(ImageFile.ImageFile):
# Set logical frame to requested position # Set logical frame to requested position
self.__logical_frame = frame self.__logical_frame = frame
def _reset(self, reset=True): def _reset(self):
if reset:
self._decoder.reset() self._decoder.reset()
self.__physical_frame = 0 self.__physical_frame = 0
self.__loaded = -1 self.__loaded = -1

View File

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