Skip to content

Commit 10b48a6

Browse files
authored
Merge branch 'main' into exif
2 parents 492943a + bebf038 commit 10b48a6

6 files changed

Lines changed: 24 additions & 16 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"

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/installation.rst

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

179179
* Pillow has been tested with openjpeg **2.0.0**, **2.1.0**, **2.3.1**,
180-
**2.4.0** and **2.5.0**.
180+
**2.4.0**, **2.5.0** and **2.5.2**.
181181
* Pillow does **not** support the earlier **1.5** series which ships
182182
with Debian Jessie.
183183

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

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)