mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
Merge branch 'main' into resize_i16
This commit is contained in:
commit
42ad42c174
2
.github/workflows/cifuzz.yml
vendored
2
.github/workflows/cifuzz.yml
vendored
|
@ -24,8 +24,6 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Fuzzing:
|
Fuzzing:
|
||||||
# Disabled until google/oss-fuzz#11419 upgrades Python to 3.9+
|
|
||||||
if: false
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Build Fuzzers
|
- name: Build Fuzzers
|
||||||
|
|
36
.github/workflows/wheels-dependencies.sh
vendored
36
.github/workflows/wheels-dependencies.sh
vendored
|
@ -16,11 +16,7 @@ ARCHIVE_SDIR=pillow-depends-main
|
||||||
|
|
||||||
# Package versions for fresh source builds
|
# Package versions for fresh source builds
|
||||||
FREETYPE_VERSION=2.13.2
|
FREETYPE_VERSION=2.13.2
|
||||||
if [[ -n "$IS_MACOS" ]] || ([[ "$MB_ML_VER" != 2014 ]] && [[ -z "$SANITIZER" ]]); then
|
HARFBUZZ_VERSION=10.0.1
|
||||||
HARFBUZZ_VERSION=10.0.1
|
|
||||||
else
|
|
||||||
HARFBUZZ_VERSION=8.5.0
|
|
||||||
fi
|
|
||||||
LIBPNG_VERSION=1.6.44
|
LIBPNG_VERSION=1.6.44
|
||||||
JPEGTURBO_VERSION=3.0.4
|
JPEGTURBO_VERSION=3.0.4
|
||||||
OPENJPEG_VERSION=2.5.2
|
OPENJPEG_VERSION=2.5.2
|
||||||
|
@ -65,21 +61,15 @@ function build_brotli {
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_harfbuzz {
|
function build_harfbuzz {
|
||||||
if [[ "$HARFBUZZ_VERSION" == 8.5.0 ]]; then
|
python3 -m pip install meson ninja
|
||||||
export FREETYPE_LIBS=-lfreetype
|
|
||||||
export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/
|
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
|
||||||
build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no
|
(cd $out_dir \
|
||||||
export FREETYPE_LIBS=""
|
&& meson setup build --buildtype=release -Dfreetype=enabled -Dglib=disabled)
|
||||||
export FREETYPE_CFLAGS=""
|
(cd $out_dir/build \
|
||||||
else
|
&& meson install)
|
||||||
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
|
if [[ "$MB_ML_LIBC" == "manylinux" ]]; then
|
||||||
(cd $out_dir \
|
cp /usr/local/lib64/libharfbuzz* /usr/local/lib
|
||||||
&& meson setup build --buildtype=release -Dfreetype=enabled -Dglib=disabled)
|
|
||||||
(cd $out_dir/build \
|
|
||||||
&& meson install)
|
|
||||||
if [[ "$MB_ML_LIBC" == "manylinux" ]]; then
|
|
||||||
cp /usr/local/lib64/libharfbuzz* /usr/local/lib
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,11 +145,7 @@ if [[ -n "$IS_MACOS" ]]; then
|
||||||
brew remove --ignore-dependencies webp
|
brew remove --ignore-dependencies webp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
brew install meson pkg-config
|
brew install pkg-config
|
||||||
elif [[ -n "$IS_ALPINE" ]]; then
|
|
||||||
apk add meson
|
|
||||||
elif [[ "$HARFBUZZ_VERSION" != 8.5.0 ]]; then
|
|
||||||
yum install -y meson
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wrap_wheel_builder build
|
wrap_wheel_builder build
|
||||||
|
|
2
.github/workflows/wheels.yml
vendored
2
.github/workflows/wheels.yml
vendored
|
@ -278,7 +278,7 @@ jobs:
|
||||||
path: dist
|
path: dist
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Upload wheels to scientific-python-nightly-wheels
|
- name: Upload wheels to scientific-python-nightly-wheels
|
||||||
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0
|
uses: scientific-python/upload-nightly-action@ccf29c805b5d0c1dc31fa97fcdb962be074cade3 # 0.6.0
|
||||||
with:
|
with:
|
||||||
artifacts_path: dist
|
artifacts_path: dist
|
||||||
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
|
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
|
||||||
|
|
|
@ -5,15 +5,15 @@ Changelog (Pillow)
|
||||||
11.0.0 (unreleased)
|
11.0.0 (unreleased)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
- Improved copying imagequant libraries #8420
|
||||||
|
[radarhere]
|
||||||
|
|
||||||
- Use Capsule for WebP saving #8386
|
- Use Capsule for WebP saving #8386
|
||||||
[homm, radarhere]
|
[homm, radarhere]
|
||||||
|
|
||||||
- Fixed writing multiple StripOffsets to TIFF #8317
|
- Fixed writing multiple StripOffsets to TIFF #8317
|
||||||
[Yay295, radarhere]
|
[Yay295, radarhere]
|
||||||
|
|
||||||
- Shared imagequant libraries may be located within usr/lib64 #8407
|
|
||||||
[radarhere]
|
|
||||||
|
|
||||||
- Fix dereference before checking for NULL in ImagingTransformAffine #8398
|
- Fix dereference before checking for NULL in ImagingTransformAffine #8398
|
||||||
[PavlNekrasov]
|
[PavlNekrasov]
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -117,7 +117,7 @@ lint-fix:
|
||||||
python3 -c "import black" > /dev/null 2>&1 || python3 -m pip install black
|
python3 -c "import black" > /dev/null 2>&1 || python3 -m pip install black
|
||||||
python3 -m black .
|
python3 -m black .
|
||||||
python3 -c "import ruff" > /dev/null 2>&1 || python3 -m pip install ruff
|
python3 -c "import ruff" > /dev/null 2>&1 || python3 -m pip install ruff
|
||||||
python3 -m ruff --fix .
|
python3 -m ruff check --fix .
|
||||||
|
|
||||||
.PHONY: mypy
|
.PHONY: mypy
|
||||||
mypy:
|
mypy:
|
||||||
|
|
|
@ -23,19 +23,14 @@ else
|
||||||
cargo cinstall --prefix=/usr --destdir=.
|
cargo cinstall --prefix=/usr --destdir=.
|
||||||
|
|
||||||
# Copy into place
|
# Copy into place
|
||||||
if [ -d "usr/lib64" ]; then
|
sudo find usr -name libimagequant.so* -exec cp {} /usr/lib/ \;
|
||||||
lib="lib64"
|
|
||||||
else
|
|
||||||
lib="lib"
|
|
||||||
fi
|
|
||||||
sudo cp usr/$lib/libimagequant.so* /usr/lib/
|
|
||||||
sudo cp usr/include/libimagequant.h /usr/include/
|
sudo cp usr/include/libimagequant.h /usr/include/
|
||||||
|
|
||||||
if [ -n "$GITHUB_ACTIONS" ]; then
|
if [ -n "$GITHUB_ACTIONS" ]; then
|
||||||
# Copy to cache
|
# Copy to cache
|
||||||
rm -rf ~/cache-$archive_name
|
rm -rf ~/cache-$archive_name
|
||||||
mkdir ~/cache-$archive_name
|
mkdir ~/cache-$archive_name
|
||||||
cp usr/lib/libimagequant.so* ~/cache-$archive_name/
|
find usr -name libimagequant.so* -exec cp {} ~/cache-$archive_name/ \;
|
||||||
cp usr/include/libimagequant.h ~/cache-$archive_name/
|
cp usr/include/libimagequant.h ~/cache-$archive_name/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -97,9 +97,13 @@ config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable"
|
||||||
test-command = "cd {project} && .github/workflows/wheels-test.sh"
|
test-command = "cd {project} && .github/workflows/wheels-test.sh"
|
||||||
test-extras = "tests"
|
test-extras = "tests"
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.black]
|
||||||
fix = true
|
exclude = "wheels/multibuild"
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
exclude = [ "wheels/multibuild" ]
|
||||||
|
|
||||||
|
fix = true
|
||||||
lint.select = [
|
lint.select = [
|
||||||
"C4", # flake8-comprehensions
|
"C4", # flake8-comprehensions
|
||||||
"E", # pycodestyle errors
|
"E", # pycodestyle errors
|
||||||
|
|
|
@ -791,15 +791,15 @@ ImagingGenericTransform(
|
||||||
char *out;
|
char *out;
|
||||||
double xx, yy;
|
double xx, yy;
|
||||||
|
|
||||||
|
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
|
||||||
|
return (Imaging)ImagingError_ModeError();
|
||||||
|
}
|
||||||
|
|
||||||
ImagingTransformFilter filter = getfilter(imIn, filterid);
|
ImagingTransformFilter filter = getfilter(imIn, filterid);
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
return (Imaging)ImagingError_ValueError("bad filter number");
|
return (Imaging)ImagingError_ValueError("bad filter number");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
|
|
||||||
return (Imaging)ImagingError_ModeError();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImagingCopyPalette(imOut, imIn);
|
ImagingCopyPalette(imOut, imIn);
|
||||||
|
|
||||||
ImagingSectionEnter(&cookie);
|
ImagingSectionEnter(&cookie);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user