Skip to content

Commit

Permalink
libheif -> 1.13.0 #38
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Sep 11, 2022
1 parent 409162a commit 870c155
Show file tree
Hide file tree
Showing 31 changed files with 216 additions and 1,385 deletions.
153 changes: 146 additions & 7 deletions .github/workflows/create-release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
cd libheif/windows/mingw-w64-libheif
makepkg-mingw --syncdeps --noconfirm -f
pacman -U mingw-w64-x86_64-libheif-1.12.0-9-any.pkg.tar.zst --noconfirm
pacman -U mingw-w64-x86_64-libheif-1.13.0-2-any.pkg.tar.zst --noconfirm
- name: Remove DLL trailing data
run: ${{ env.MSYS2_PREFIX }}/bin/strip -s ${{ env.MSYS2_PREFIX }}/bin/*.dll
Expand All @@ -68,6 +68,7 @@ jobs:
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-*"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel} --add-path ${{ env.MSYS2_PREFIX }}/bin"
CIBW_ENVIRONMENT_WINDOWS: PH_FULL_ACTION=1

- name: Check built wheels
run: twine check wheelhouse/*
Expand All @@ -93,6 +94,7 @@ jobs:
CIBW_BUILD: "*-macosx_x86_64"
CIBW_SKIP: "cp36-* pp39-*"
CIBW_TEST_SKIP: "cp311-*"
CIBW_ENVIRONMENT_MACOS: PH_FULL_ACTION=1

- name: Check built wheels
run: twine check wheelhouse/*
Expand All @@ -109,7 +111,7 @@ jobs:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
cibw_arch: [ "aarch64", "i686", "x86_64" ]
cibw_arch: [ "aarch64", "x86_64" ]
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • CPython
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -162,7 +164,80 @@ jobs:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_FULL_ACTION=1

- name: Checking built wheels
run: twine check wheelhouse/*

- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse/*.whl
if-no-files-found: error

- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR_PREFIX }}

wheels_linux_cpython_32bit:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux, musllinux ]
cibw_arch: [ "i686" ]
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • CPython
runs-on: ubuntu-20.04
env:
BUILD_DIR_PREFIX: "/tmp/pillow_heif"
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Install cibuildwheel & twine
run: python3 -m pip install cibuildwheel twine

- name: manylinux preparations
if: matrix.cibw_buildlinux == 'manylinux'
run: echo INSTALL_OS_PACKAGES="yum makecache && yum install -y $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "git-all libjpeg-turbo-devel lcms2-devel libffi-devel"

- name: musllinux preparations
if: matrix.cibw_buildlinux == 'musllinux'
run: echo INSTALL_OS_PACKAGES="apk update && apk --no-cache add $OS_PACKAGES" >> $GITHUB_ENV
env:
OS_PACKAGES: "sudo py3-pip python3-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev openjpeg-dev"

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR_PREFIX }}/build-tools
key: ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/linux_build_tools.py') }}

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff
key: ${{ env.KEY_HEAD }}-${{ env.KEY_CFFI_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/linux/**') }}
KEY_CFFI_BUILD: ${{ hashFiles('libheif/build.py') }}-${{ hashFiles('libheif/heif.h') }}

- name: Run cibuildwheel
run: cibuildwheel
env:
CIBW_BUILD: ${{ format('cp3*-{0}_{1}', matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: ${{ env.INSTALL_OS_PACKAGES }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_LIGHT_ACTION=1

- name: Checking built wheels
run: twine check wheelhouse/*
Expand All @@ -182,7 +257,7 @@ jobs:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux ]
cibw_arch: [ "aarch64", "i686", "x86_64" ]
cibw_arch: [ "aarch64", "x86_64" ]
cibw_build: [ "pp37", "pp38" ]
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_build }}
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -224,7 +299,69 @@ jobs:
CIBW_BUILD: ${{ format('{0}-{1}_{2}', matrix.cibw_build , matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: "yum makecache && yum install -y git-all libjpeg-turbo-devel lcms2-devel libffi-devel"
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }}
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_FULL_ACTION=1

- name: Checking built wheels
run: twine check wheelhouse/*

- name: Uploading wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse/*.whl
if-no-files-found: error

- name: Fix cache permissions
run: sudo chmod -R 777 ${{ env.BUILD_DIR_PREFIX }}

wheels_linux_pypy_32bit:
strategy:
fail-fast: true
matrix:
cibw_buildlinux: [ manylinux ]
cibw_arch: [ "i686" ]
cibw_build: [ "pp37", "pp38" ]
name: Wheels • ${{ matrix.cibw_buildlinux }} • ${{ matrix.cibw_arch }} • ${{ matrix.cibw_build }}
runs-on: ubuntu-20.04
env:
BUILD_DIR_PREFIX: "/tmp/pillow_heif"
KEY_HEAD: ${{ matrix.cibw_arch }}-${{ matrix.cibw_buildlinux }}

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: matrix.cibw_arch == 'aarch64'
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Install cibuildwheel & twine
run: python3 -m pip install cibuildwheel twine

- name: Only minimal testing on aarch64
if: matrix.cibw_arch == 'aarch64'
run: echo CIBW_TEST_EXTRAS="tests-min" >> $GITHUB_ENV

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR_PREFIX }}/build-tools
key: ${{ env.KEY_HEAD }}-${{ hashFiles('libheif/linux_build_tools.py') }}

- uses: actions/cache@v3
with:
path: ${{ env.BUILD_DIR_PREFIX }}/build-stuff
key: ${{ env.KEY_HEAD }}-${{ env.KEY_CFFI_BUILD }}-${{ env.KEY_LINUX_LIBS }}
env:
KEY_LINUX_LIBS: ${{ hashFiles('libheif/linux_*.py') }}-${{ hashFiles('libheif/linux/**') }}
KEY_CFFI_BUILD: ${{ hashFiles('libheif/build.py') }}-${{ hashFiles('libheif/heif.h') }}

- name: Run cibuildwheel
run: cibuildwheel
env:
CIBW_BUILD: ${{ format('{0}-{1}_{2}', matrix.cibw_build , matrix.cibw_buildlinux, matrix.cibw_arch) }}
CIBW_ARCHS: ${{ matrix.cibw_arch }}
CIBW_BEFORE_ALL_LINUX: "yum makecache && yum install -y git-all libjpeg-turbo-devel lcms2-devel libffi-devel"
CIBW_ENVIRONMENT_LINUX: BUILD_DIR_PREFIX=/host${{ env.BUILD_DIR_PREFIX }} PH_LIGHT_ACTION=1

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

- name: Test sdist
run: python3 -m pytest -rs
run: |
export PH_FULL_ACTION=1
python3 -m pytest -rs
- name: Upload sdist
uses: actions/upload-artifact@v3
Expand All @@ -284,7 +423,7 @@ jobs:
path: wheelhouse/*.tar.gz

draft_release:
needs: [sdist, wheels_linux_cpython, wheels_linux_pypy, wheels_macos, wheels_windows, wheel_armv7l]
needs: [sdist, wheels_linux_cpython, wheels_linux_pypy, wheels_macos, wheels_windows, wheel_armv7l, wheels_linux_pypy_32bit, wheels_linux_cpython_32bit]
runs-on: ubuntu-20.04
name: Build and create release

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-src-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
cd libheif/windows/mingw-w64-libheif
makepkg-mingw --syncdeps --noconfirm -f
pacman -U mingw-w64-x86_64-libheif-1.12.0-9-any.pkg.tar.zst --noconfirm
pacman -U mingw-w64-x86_64-libheif-1.13.0-2-any.pkg.tar.zst --noconfirm
- name: Installing Pillow-Heif
run: python -m pip -v install ".[dev]"
Expand Down
40 changes: 40 additions & 0 deletions libheif/linux/libheif/001-aom-remove-extend_padding_to_size.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From a01baccaf40bafcabddba47846f5e914ca0724f6 Mon Sep 17 00:00:00 2001
From: Dirk Farin <[email protected]>
Date: Mon, 5 Sep 2022 14:38:53 +0200
Subject: [PATCH] AOM encoder: remove unnecessary call to
extend_padding_to_size() (see also #365)

---
libheif/heif_encoder_aom.cc | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/libheif/heif_encoder_aom.cc b/libheif/heif_encoder_aom.cc
index 2a035654..e5136c1e 100644
--- a/libheif/heif_encoder_aom.cc
+++ b/libheif/heif_encoder_aom.cc
@@ -119,7 +119,7 @@ void encoder_struct_aom::add_custom_option(std::string name, std::string value)
}
#endif

-static const char* kError_out_of_memory = "Out of memory";
+//static const char* kError_out_of_memory = "Out of memory";
static const char* kError_encode_frame = "Failed to encode frame";

static const char* kParam_min_q = "min-q";
@@ -727,16 +727,6 @@ struct heif_error aom_encode_image(void* encoder_raw, const struct heif_image* i

struct heif_error err;

- bool success = image->image->extend_padding_to_size(image->image->get_width(),
- image->image->get_height());
- if (!success) {
- err = {heif_error_Memory_allocation_error,
- heif_suberror_Unspecified,
- kError_out_of_memory};
- return err;
- }
-
-
const int source_width = heif_image_get_width(image, heif_channel_Y);
const int source_height = heif_image_get_height(image, heif_channel_Y);

65 changes: 0 additions & 65 deletions libheif/linux/libheif/010-fix-loading-alpha-image.patch

This file was deleted.

57 changes: 0 additions & 57 deletions libheif/linux/libheif/011-fix-loading-alpha-image.patch

This file was deleted.

Loading

0 comments on commit 870c155

Please sign in to comment.