Skip to content

Commit e39fb2e

Browse files
committed
Merge branch 'main' into install-doc-dir
2 parents fd1cefe + bebf038 commit e39fb2e

10 files changed

Lines changed: 25 additions & 25 deletions

File tree

.github/workflows/wheels-dependencies.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ FREETYPE_VERSION=2.13.2
1919
HARFBUZZ_VERSION=8.3.0
2020
LIBPNG_VERSION=1.6.40
2121
JPEGTURBO_VERSION=3.0.1
22-
OPENJPEG_VERSION=2.5.0
22+
OPENJPEG_VERSION=2.5.2
2323
XZ_VERSION=5.4.5
2424
TIFF_VERSION=4.6.0
2525
LCMS2_VERSION=2.16
@@ -40,7 +40,7 @@ BROTLI_VERSION=1.1.0
4040

4141
if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then
4242
function build_openjpeg {
43-
local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz openjpeg-2.5.0.tar.gz)
43+
local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz openjpeg-${OPENJPEG_VERSION}.tar.gz)
4444
(cd $out_dir \
4545
&& cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \
4646
&& make install)
@@ -93,6 +93,9 @@ function build {
9393
done
9494
fi
9595
build_openjpeg
96+
if [ -f /usr/local/lib64/libopenjp2.so ]; then
97+
cp /usr/local/lib64/libopenjp2.so /usr/local/lib
98+
fi
9699

97100
ORIGINAL_CFLAGS=$CFLAGS
98101
CFLAGS="$CFLAGS -O3 -DNDEBUG"

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ As of 2019, Pillow development is
8282
<a href="https://gitter.im/python-pillow/Pillow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img
8383
alt="Join the chat at https://gitter.im/python-pillow/Pillow"
8484
src="https://badges.gitter.im/python-pillow/Pillow.svg"></a>
85-
<a href="https://twitter.com/PythonPillow"><img
86-
alt="Follow on https://twitter.com/PythonPillow"
87-
src="https://img.shields.io/badge/tweet-on%20Twitter-00aced.svg"></a>
8885
<a href="https://fosstodon.org/@pillow"><img
8986
alt="Follow on https://fosstodon.org/@pillow"
9087
src="https://img.shields.io/badge/publish-on%20Mastodon-595aff.svg"

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Released as needed privately to individual vendors for critical security-related
8686

8787
## Publicize Release
8888

89-
* [ ] Announce release availability via [Twitter](https://twitter.com/pythonpillow) and [Mastodon](https://fosstodon.org/@pillow) e.g. https://twitter.com/PythonPillow/status/1013789184354603010
89+
* [ ] Announce release availability via [Mastodon](https://fosstodon.org/@pillow) e.g. https://fosstodon.org/@pillow/110639450470725321
9090

9191
## Documentation
9292

depends/install_openjpeg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# install openjpeg
33

4-
archive=openjpeg-2.5.0
4+
archive=openjpeg-2.5.2
55

66
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/main/$archive.tar.gz
77

docs/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more <h
7373
:target: https://gitter.im/python-pillow/Pillow?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
7474
:alt: Join the chat at https://gitter.im/python-pillow/Pillow
7575

76-
.. image:: https://img.shields.io/badge/tweet-on%20Twitter-00aced.svg
77-
:target: https://twitter.com/PythonPillow
78-
:alt: Follow on https://twitter.com/PythonPillow
79-
8076
.. image:: https://img.shields.io/badge/publish-on%20Mastodon-595aff.svg
8177
:target: https://fosstodon.org/@pillow
8278
:alt: Follow on https://fosstodon.org/@pillow

docs/installation/building-from-source.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Many of Pillow's features require external libraries:
5454
* **openjpeg** provides JPEG 2000 functionality.
5555

5656
* Pillow has been tested with openjpeg **2.0.0**, **2.1.0**, **2.3.1**,
57-
**2.4.0** and **2.5.0**.
57+
**2.4.0**, **2.5.0** and **2.5.2**.
5858
* Pillow does **not** support the earlier **1.5** series which ships
5959
with Debian Jessie.
6060

docs/reference/ImageOps.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ only work on L and RGB images.
1414
.. autofunction:: colorize
1515
.. autofunction:: crop
1616
.. autofunction:: scale
17+
.. autoclass:: SupportsGetMesh
18+
:show-inheritance:
1719
.. autofunction:: deform
1820
.. autofunction:: equalize
1921
.. autofunction:: expand

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Homepage = "https://python-pillow.org"
8181
Mastodon = "https://fosstodon.org/@pillow"
8282
"Release notes" = "https://pillow.readthedocs.io/en/stable/releasenotes/index.html"
8383
Source = "https://github.com/python-pillow/Pillow"
84-
Twitter = "https://twitter.com/PythonPillow"
8584

8685
[tool.setuptools]
8786
packages = ["PIL"]

src/PIL/ImageOps.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,15 @@ def scale(
411411
return image.resize(size, resample)
412412

413413

414-
class _SupportsGetMesh(Protocol):
414+
class SupportsGetMesh(Protocol):
415+
"""
416+
An object that supports the ``getmesh`` method, taking an image as an
417+
argument, and returning a list of tuples. Each tuple contains two tuples,
418+
the source box as a tuple of 4 integers, and a tuple of 8 integers for the
419+
final quadrilateral, in order of top left, bottom left, bottom right, top
420+
right.
421+
"""
422+
415423
def getmesh(
416424
self, image: Image.Image
417425
) -> list[
@@ -421,7 +429,7 @@ def getmesh(
421429

422430
def deform(
423431
image: Image.Image,
424-
deformer: _SupportsGetMesh,
432+
deformer: SupportsGetMesh,
425433
resample: int = Image.Resampling.BILINEAR,
426434
) -> Image.Image:
427435
"""

winbuild/build_prepare.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,21 +308,16 @@ def cmd_msbuild(
308308
"libs": [r"Lib\MS\*.lib"],
309309
},
310310
"openjpeg": {
311-
"url": "https://github.com/uclouvain/openjpeg/archive/v2.5.0.tar.gz",
312-
"filename": "openjpeg-2.5.0.tar.gz",
313-
"dir": "openjpeg-2.5.0",
311+
"url": "https://github.com/uclouvain/openjpeg/archive/v2.5.2.tar.gz",
312+
"filename": "openjpeg-2.5.2.tar.gz",
313+
"dir": "openjpeg-2.5.2",
314314
"license": "LICENSE",
315-
"patch": {
316-
r"src\lib\openjp2\ht_dec.c": {
317-
"#ifdef OPJ_COMPILER_MSVC\n return (OPJ_UINT32)__popcnt(val);": "#if defined(OPJ_COMPILER_MSVC) && (defined(_M_IX86) || defined(_M_AMD64))\n return (OPJ_UINT32)__popcnt(val);", # noqa: E501
318-
}
319-
},
320315
"build": [
321316
*cmds_cmake(
322317
"openjp2", "-DBUILD_CODEC:BOOL=OFF", "-DBUILD_SHARED_LIBS:BOOL=OFF"
323318
),
324-
cmd_mkdir(r"{inc_dir}\openjpeg-2.5.0"),
325-
cmd_copy(r"src\lib\openjp2\*.h", r"{inc_dir}\openjpeg-2.5.0"),
319+
cmd_mkdir(r"{inc_dir}\openjpeg-2.5.2"),
320+
cmd_copy(r"src\lib\openjp2\*.h", r"{inc_dir}\openjpeg-2.5.2"),
326321
],
327322
"libs": [r"bin\*.lib"],
328323
},

0 commit comments

Comments
 (0)