Merge branch 'main' into context_manager

This commit is contained in:
Andrew Murray 2024-10-13 11:06:01 +11:00
commit 988a1fe838
7 changed files with 21 additions and 33 deletions

View File

@ -38,16 +38,6 @@ BZIP2_VERSION=1.0.8
LIBXCB_VERSION=1.17.0
BROTLI_VERSION=1.1.0
if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then
function build_openjpeg {
local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v$OPENJPEG_VERSION.tar.gz openjpeg-$OPENJPEG_VERSION.tar.gz)
(cd $out_dir \
&& cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \
&& make install)
touch openjpeg-stamp
}
fi
function build_brotli {
local cmake=$(get_modern_cmake)
local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz brotli-$BROTLI_VERSION.tar.gz)

View File

@ -70,6 +70,7 @@ repos:
rev: v0.20.2
hooks:
- id: validate-pyproject
additional_dependencies: [trove-classifiers>=2024.10.12]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.4.1

View File

@ -5,6 +5,15 @@ Changelog (Pillow)
11.0.0 (unreleased)
-------------------
- Conditionally define ImageCms type hint to avoid requiring core #8197
[radarhere]
- Support writing LONG8 offsets in AppendingTiffWriter #8417
[radarhere]
- Use ImageFile.MAXBLOCK when saving TIFF images #8461
[radarhere]
- Do not close provided file handles with libtiff when saving #8458
[radarhere]

View File

@ -1,19 +1,6 @@
11.0.0
------
Security
========
TODO
^^^^
TODO
:cve:`YYYY-XXXXX`: TODO
^^^^^^^^^^^^^^^^^^^^^^^
TODO
Backwards Incompatible Changes
==============================
@ -159,7 +146,7 @@ Python 3.13
Pillow 10.4.0 had wheels built against Python 3.13 beta, available as a preview to help
others prepare for 3.13, and to ensure Pillow could be used immediately at the release
of 3.13.0 final (2024-10-01, :pep:`719`).
of 3.13.0 final (2024-10-07, :pep:`719`).
Pillow 11.0.0 now officially supports Python 3.13.

View File

@ -14,14 +14,14 @@ readme = "README.md"
keywords = [
"Imaging",
]
license = { text = "HPND" }
license = { text = "MIT-CMU" }
authors = [
{ name = "Jeffrey A. Clark", email = "aclark@aclark.net" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 6 - Mature",
"License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)",
"License :: OSI Approved :: CMU License (MIT-CMU)",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",

View File

@ -173,10 +173,10 @@ class _Operand:
return self.apply("rshift", self, other)
# logical
def __eq__(self, other):
def __eq__(self, other: _Operand | float) -> _Operand: # type: ignore[override]
return self.apply("eq", self, other)
def __ne__(self, other):
def __ne__(self, other: _Operand | float) -> _Operand: # type: ignore[override]
return self.apply("ne", self, other)
def __lt__(self, other: _Operand | float) -> _Operand:

View File

@ -1194,11 +1194,11 @@ class TiffImageFile(ImageFile.ImageFile):
if not self._seek_check(frame):
return
self._seek(frame)
# Create a new core image object on second and
# subsequent frames in the image. Image may be
# different size/mode.
Image._decompression_bomb_check(self._tile_size)
self.im = Image.core.new(self.mode, self._tile_size)
if self._im is not None and (
self.im.size != self._tile_size or self.im.mode != self.mode
):
# The core image will no longer be used
self._im = None
def _seek(self, frame: int) -> None:
if isinstance(self._fp, DeferredError):
@ -1282,6 +1282,7 @@ class TiffImageFile(ImageFile.ImageFile):
def load_prepare(self) -> None:
if self._im is None:
Image._decompression_bomb_check(self._tile_size)
self.im = Image.core.new(self.mode, self._tile_size)
ImageFile.ImageFile.load_prepare(self)