Skip to content

Commit 870c155

Browse files
committed
libheif -> 1.13.0 #38
1 parent 409162a commit 870c155

31 files changed

+216
-1385
lines changed

.github/workflows/create-release-draft.yml

Lines changed: 146 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
cd libheif/windows/mingw-w64-libheif
5959
makepkg-mingw --syncdeps --noconfirm -f
60-
pacman -U mingw-w64-x86_64-libheif-1.12.0-9-any.pkg.tar.zst --noconfirm
60+
pacman -U mingw-w64-x86_64-libheif-1.13.0-2-any.pkg.tar.zst --noconfirm
6161
6262
- name: Remove DLL trailing data
6363
run: ${{ env.MSYS2_PREFIX }}/bin/strip -s ${{ env.MSYS2_PREFIX }}/bin/*.dll
@@ -68,6 +68,7 @@ jobs:
6868
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-*"
6969
CIBW_ARCHS_WINDOWS: "AMD64"
7070
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"
71+
CIBW_ENVIRONMENT_WINDOWS: PH_FULL_ACTION=1
7172

7273
- name: Check built wheels
7374
run: twine check wheelhouse/*
@@ -93,6 +94,7 @@ jobs:
9394
CIBW_BUILD: "*-macosx_x86_64"
9495
CIBW_SKIP: "cp36-* pp39-*"
9596
CIBW_TEST_SKIP: "cp311-*"
97+
CIBW_ENVIRONMENT_MACOS: PH_FULL_ACTION=1
9698

9799
- name: Check built wheels
98100
run: twine check wheelhouse/*
@@ -109,7 +111,7 @@ jobs:
109111
fail-fast: true
110112
matrix:
111113
cibw_buildlinux: [ manylinux, musllinux ]
112-
cibw_arch: [ "aarch64", "i686", "x86_64" ]
114+
cibw_arch: [ "aarch64", "x86_64" ]
113115
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • CPython
114116
runs-on: ubuntu-20.04
115117
env:
@@ -162,7 +164,80 @@ jobs:
162164
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
163165
CIBW_ARCHS: ${{ matrix.cibw_arch }}
164166
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
165-
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }}
167+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_FULL_ACTION=1
168+
169+
- name: Checking built wheels
170+
run: twine check wheelhouse/*
171+
172+
- name: Uploading wheels
173+
uses: actions/upload-artifact@v3
174+
with:
175+
name: wheels
176+
path: wheelhouse/*.whl
177+
if-no-files-found: error
178+
179+
- name: Fix cache permissions
180+
run: sudo chmod -R 777 ${{ env.BUILD_DIR_PREFIX }}
181+
182+
wheels_linux_cpython_32bit:
183+
strategy:
184+
fail-fast: true
185+
matrix:
186+
cibw_buildlinux: [ manylinux, musllinux ]
187+
cibw_arch: [ "i686" ]
188+
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • CPython
189+
runs-on: ubuntu-20.04
190+
env:
191+
BUILD_DIR_PREFIX: "/tmp/pillow_heif"
192+
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
193+
194+
steps:
195+
- uses: actions/checkout@v3
196+
- name: Set up QEMU
197+
if: matrix.cibw_arch == 'aarch64'
198+
uses: docker/setup-qemu-action@v2
199+
with:
200+
platforms: arm64
201+
202+
- name: Install cibuildwheel & twine
203+
run: python3 -m pip install cibuildwheel twine
204+
205+
- name: manylinux preparations
206+
if: matrix.cibw_buildlinux == 'manylinux'
207+
run: echo INSTALL_OS_PACKAGES="yum makecache && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
208+
env:
209+
OS_PACKAGES: "git-all libjpeg-turbo-devel lcms2-devel libffi-devel"
210+
211+
- name: musllinux preparations
212+
if: matrix.cibw_buildlinux == 'musllinux'
213+
run: echo INSTALL_OS_PACKAGES="apk update && apk --no-cache add $OS_PACKAGES" >> $GITHUB_ENV
214+
env:
215+
OS_PACKAGES: "sudo py3-pip python3-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"
216+
217+
- name: Only minimal testing on aarch64
218+
if: matrix.cibw_arch == 'aarch64'
219+
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
220+
221+
- uses: actions/cache@v3
222+
with:
223+
path: ${{ env.BUILD_DIR_PREFIX }}/build-tools
224+
key: ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/linux_build_tools.py') }}
225+
226+
- uses: actions/cache@v3
227+
with:
228+
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff
229+
key: ${{ env.KEY_HEAD }}-${{ env.KEY_CFFI_BUILD }}-${{ env.KEY_LINUX_LIBS }}
230+
env:
231+
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/linux/**') }}
232+
KEY_CFFI_BUILD: ${{ hashFiles('libheif/build.py') }}-${{ hashFiles('libheif/heif.h') }}
233+
234+
- name: Run cibuildwheel
235+
run: cibuildwheel
236+
env:
237+
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
238+
CIBW_ARCHS: ${{ matrix.cibw_arch }}
239+
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
240+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_LIGHT_ACTION=1
166241

167242
- name: Checking built wheels
168243
run: twine check wheelhouse/*
@@ -182,7 +257,7 @@ jobs:
182257
fail-fast: true
183258
matrix:
184259
cibw_buildlinux: [ manylinux ]
185-
cibw_arch: [ "aarch64", "i686", "x86_64" ]
260+
cibw_arch: [ "aarch64", "x86_64" ]
186261
cibw_build: [ "pp37", "pp38" ]
187262
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_build }}
188263
runs-on: ubuntu-20.04
@@ -224,7 +299,69 @@ jobs:
224299
CIBW_BUILD: ${{ format('{0}-{1}_{2}', matrix.cibw_build , matrix.cibw_buildlinux, matrix.cibw_arch) }}
225300
CIBW_ARCHS: ${{ matrix.cibw_arch }}
226301
CIBW_BEFORE_ALL_LINUX: "yum makecache && yum install -y git-all libjpeg-turbo-devel lcms2-devel libffi-devel"
227-
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }}
302+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_FULL_ACTION=1
303+
304+
- name: Checking built wheels
305+
run: twine check wheelhouse/*
306+
307+
- name: Uploading wheels
308+
uses: actions/upload-artifact@v3
309+
with:
310+
name: wheels
311+
path: wheelhouse/*.whl
312+
if-no-files-found: error
313+
314+
- name: Fix cache permissions
315+
run: sudo chmod -R 777 ${{ env.BUILD_DIR_PREFIX }}
316+
317+
wheels_linux_pypy_32bit:
318+
strategy:
319+
fail-fast: true
320+
matrix:
321+
cibw_buildlinux: [ manylinux ]
322+
cibw_arch: [ "i686" ]
323+
cibw_build: [ "pp37", "pp38" ]
324+
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_build }}
325+
runs-on: ubuntu-20.04
326+
env:
327+
BUILD_DIR_PREFIX: "/tmp/pillow_heif"
328+
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}
329+
330+
steps:
331+
- uses: actions/checkout@v3
332+
- name: Set up QEMU
333+
if: matrix.cibw_arch == 'aarch64'
334+
uses: docker/setup-qemu-action@v2
335+
with:
336+
platforms: arm64
337+
338+
- name: Install cibuildwheel & twine
339+
run: python3 -m pip install cibuildwheel twine
340+
341+
- name: Only minimal testing on aarch64
342+
if: matrix.cibw_arch == 'aarch64'
343+
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV
344+
345+
- uses: actions/cache@v3
346+
with:
347+
path: ${{ env.BUILD_DIR_PREFIX }}/build-tools
348+
key: ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/linux_build_tools.py') }}
349+
350+
- uses: actions/cache@v3
351+
with:
352+
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff
353+
key: ${{ env.KEY_HEAD }}-${{ env.KEY_CFFI_BUILD }}-${{ env.KEY_LINUX_LIBS }}
354+
env:
355+
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/linux/**') }}
356+
KEY_CFFI_BUILD: ${{ hashFiles('libheif/build.py') }}-${{ hashFiles('libheif/heif.h') }}
357+
358+
- name: Run cibuildwheel
359+
run: cibuildwheel
360+
env:
361+
CIBW_BUILD: ${{ format('{0}-{1}_{2}', matrix.cibw_build , matrix.cibw_buildlinux, matrix.cibw_arch) }}
362+
CIBW_ARCHS: ${{ matrix.cibw_arch }}
363+
CIBW_BEFORE_ALL_LINUX: "yum makecache && yum install -y git-all libjpeg-turbo-devel lcms2-devel libffi-devel"
364+
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_LIGHT_ACTION=1
228365

229366
- name: Checking built wheels
230367
run: twine check wheelhouse/*
@@ -275,7 +412,9 @@ jobs:
275412
run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())"
276413

277414
- name: Test sdist
278-
run: python3 -m pytest -rs
415+
run: |
416+
export PH_FULL_ACTION=1
417+
python3 -m pytest -rs
279418
280419
- name: Upload sdist
281420
uses: actions/upload-artifact@v3
@@ -284,7 +423,7 @@ jobs:
284423
path: wheelhouse/*.tar.gz
285424

286425
draft_release:
287-
needs: [sdist, wheels_linux_cpython, wheels_linux_pypy, wheels_macos, wheels_windows, wheel_armv7l]
426+
needs: [sdist, wheels_linux_cpython, wheels_linux_pypy, wheels_macos, wheels_windows, wheel_armv7l, wheels_linux_pypy_32bit, wheels_linux_cpython_32bit]
288427
runs-on: ubuntu-20.04
289428
name: Build and create release
290429

.github/workflows/test-src-build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
cd libheif/windows/mingw-w64-libheif
4949
makepkg-mingw --syncdeps --noconfirm -f
50-
pacman -U mingw-w64-x86_64-libheif-1.12.0-9-any.pkg.tar.zst --noconfirm
50+
pacman -U mingw-w64-x86_64-libheif-1.13.0-2-any.pkg.tar.zst --noconfirm
5151
5252
- name: Installing Pillow-Heif
5353
run: python -m pip -v install ".[dev]"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From a01baccaf40bafcabddba47846f5e914ca0724f6 Mon Sep 17 00:00:00 2001
2+
From: Dirk Farin <[email protected]>
3+
Date: Mon, 5 Sep 2022 14:38:53 +0200
4+
Subject: [PATCH] AOM encoder: remove unnecessary call to
5+
extend_padding_to_size() (see also #365)
6+
7+
---
8+
libheif/heif_encoder_aom.cc | 12 +-----------
9+
1 file changed, 1 insertion(+), 11 deletions(-)
10+
11+
diff --git a/libheif/heif_encoder_aom.cc b/libheif/heif_encoder_aom.cc
12+
index 2a035654..e5136c1e 100644
13+
--- a/libheif/heif_encoder_aom.cc
14+
+++ b/libheif/heif_encoder_aom.cc
15+
@@ -119,7 +119,7 @@ void encoder_struct_aom::add_custom_option(std::string name, std::string value)
16+
}
17+
#endif
18+
19+
-static const char* kError_out_of_memory = "Out of memory";
20+
+//static const char* kError_out_of_memory = "Out of memory";
21+
static const char* kError_encode_frame = "Failed to encode frame";
22+
23+
static const char* kParam_min_q = "min-q";
24+
@@ -727,16 +727,6 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i
25+
26+
struct heif_error err;
27+
28+
- bool success = image->image->extend_padding_to_size(image->image->get_width(),
29+
- image->image->get_height());
30+
- if (!success) {
31+
- err = {heif_error_Memory_allocation_error,
32+
- heif_suberror_Unspecified,
33+
- kError_out_of_memory};
34+
- return err;
35+
- }
36+
-
37+
-
38+
const int source_width = heif_image_get_width(image, heif_channel_Y);
39+
const int source_height = heif_image_get_height(image, heif_channel_Y);
40+

libheif/linux/libheif/010-fix-loading-alpha-image.patch

Lines changed: 0 additions & 65 deletions
This file was deleted.

libheif/linux/libheif/011-fix-loading-alpha-image.patch

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)