Skip to content

Commit

Permalink
update libheif to 1.19.5 version (#312)
Browse files Browse the repository at this point in the history
* update libheif to 1.19.5 version

Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 authored Nov 28, 2024
1 parent 03c7beb commit 4c16779
Show file tree
Hide file tree
Showing 19 changed files with 472 additions and 130 deletions.
149 changes: 87 additions & 62 deletions .github/workflows/analysis-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

jobs:
analysis:
runs-on: macos-12
runs-on: macos-13
name: Analysis

steps:
Expand All @@ -31,6 +31,12 @@ jobs:
with:
python-version: '3.12'

- name: Install Libheif
run: |
brew update
brew install libheif
brew upgrade libheif
- name: Install from source
run: python3 -m pip install ".[dev]" wheel setuptools

Expand Down Expand Up @@ -62,25 +68,25 @@ jobs:
- name: LibHeif info
run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())"

- name: Generate coverage report
run: |
TEST_PLUGIN_LOAD="$(whereis libheif | awk '{print $2}')/plugins/libheif-x265.so" coverage run -m pytest
coverage xml && coverage html
- name: HTML coverage to artifacts
uses: actions/upload-artifact@v3
with:
name: coverage_linux
path: ./htmlcov
if-no-files-found: error

- name: Upload report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
verbose: true
# - name: Generate coverage report
# run: |
# TEST_PLUGIN_LOAD="$(whereis libheif | awk '{print $2}')/plugins/libheif-x265.so" coverage run -m pytest
# coverage xml && coverage html
#
# - name: HTML coverage to artifacts
# uses: actions/upload-artifact@v3
# with:
# name: coverage_linux
# path: ./htmlcov
# if-no-files-found: error
#
# - name: Upload report to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# fail_ci_if_error: true
# verbose: true

coverage-linux-pillow-dev:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -109,29 +115,29 @@ jobs:
- name: LibHeif info
run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())"

- name: Generate coverage report
run: |
TEST_PLUGIN_LOAD="$(whereis libheif | awk '{print $2}')/plugins/libheif-x265.so" coverage run -m pytest
coverage xml && coverage html
- name: HTML coverage to artifacts
uses: actions/upload-artifact@v3
with:
name: coverage_linux_dev
path: ./htmlcov
if-no-files-found: error

- name: Upload report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true
verbose: true
# - name: Generate coverage report
# run: |
# TEST_PLUGIN_LOAD="$(whereis libheif | awk '{print $2}')/plugins/libheif-x265.so" coverage run -m pytest
# coverage xml && coverage html
#
# - name: HTML coverage to artifacts
# uses: actions/upload-artifact@v3
# with:
# name: coverage_linux_dev
# path: ./htmlcov
# if-no-files-found: error
#
# - name: Upload report to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# fail_ci_if_error: true
# verbose: true

coverage-macos:
runs-on: macos-12
name: Coverage(macOS) • 🐍3.10
runs-on: macos-13
name: Coverage(macOS-13) • 🐍3.10
env:
TEST_DECODE_THREADS: 0 # This test fails on GitHub on macOS. We have such enabled test on Cirrus.

Expand All @@ -141,9 +147,14 @@ jobs:
with:
python-version: '3.10'

- name: Install from source
- name: Install Libheif
run: |
python3 -m pip -v install ".[dev]"
brew update
brew install libheif
brew upgrade libheif
- name: Install from source
run: python3 -m pip -v install ".[dev]"

- name: LibHeif info
run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())"
Expand Down Expand Up @@ -176,10 +187,14 @@ jobs:
with:
python-version: '3.11'

- name: Install from source
- name: Install Libheif
run: |
brew install --formula ./libheif/macos/libheif.rb
python3 -m pip -v install ".[dev]"
brew update
brew install libheif
brew upgrade libheif
- name: Install from source
run: python3 -m pip -v install ".[dev]"

- name: LibHeif info
run: python3 -c "import pillow_heif; print(pillow_heif.libheif_info())"
Expand Down Expand Up @@ -231,34 +246,34 @@ jobs:
Get-ChildItem -Path $Env:MSYS2_PREFIX/bin -Force | Format-List
cp ${{ env.MSYS2_PREFIX }}/bin/libheif.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libde265-0.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libx265*.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libx265-209.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libaom.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libwinpthread-1.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libgcc_s_seh-1.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libstdc++-6.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libsharpyuv-0.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libdav1d-7.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libsharpyuv-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libdav1d-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/rav1e.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libSvtAv1Enc.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libkvazaar-7.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libkvazaar-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libcryptopp.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libjpeg-8.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libopenjp2-7.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libjpeg-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libopenjp2-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/zlib1.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libSvtAv1Dec-0.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libSvtAv1Enc-2.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libSvtAv1Dec-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libSvtAv1Enc-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libbrotlicommon.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libbrotlidec.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libbrotlienc.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libtiff-6.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libtiff-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libzstd.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libwebp-7.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/liblzma-5.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libwebp-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/liblzma-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libLerc.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libdeflate.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libjbig-0.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libtiffxx-6.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libopenjph-0.*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libjbig-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libtiffxx-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libopenjph-*.dll $site_packages/
cp -ErrorAction SilentlyContinue ${{ env.MSYS2_PREFIX }}/bin/libopenh264-*.dll $site_packages/
- name: Install from source
run: |
Expand Down Expand Up @@ -366,11 +381,21 @@ jobs:
run: sudo -H PH_LIGHT_ACTION=1 EXP_PH_LIBHEIF_VERSION="" python3 -m pytest

coverage-import-error:
runs-on: macos-12
runs-on: macos-13
name: Coverage(ImportError)

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Libheif
run: |
brew update
brew install libheif
brew upgrade libheif
- name: Install from source
run: |
python3 -m pip -v install .
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-src-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
matrix:
arch: ["amd64", "arm64"]
docker_file: ["Alpine_3_19", "Alpine_3_20", "Almalinux_9", "Debian_12"]
include:
- arch: "amd64"
docker_file: "Archlinux"
- arch: "amd64"
docker_file: "Fedora_39"
# include:
# - arch: "amd64"
# docker_file: "Archlinux"
# - arch: "amd64"
# docker_file: "Fedora_39"

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-src-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ concurrency:
cancel-in-progress: true

jobs:
full_macos_12:
name: macOS:12-x86_64
runs-on: macos-12
full_macos_13:
name: macOS:13-x86_64
runs-on: macos-13
env:
TEST_DECODE_THREADS: 0 # This test fails on GitHub on macOS. We have such enabled test on Cirrus.
PH_FULL_ACTION: 1
Expand Down Expand Up @@ -79,9 +79,9 @@ jobs:
- name: Perform tests
run: python3 -m pytest

lite_macos_12:
name: macOS:12-x86_64(Pi-Heif)
runs-on: macos-12
lite_macos_13:
name: macOS:13-x86_64(Pi-Heif)
runs-on: macos-13
env:
TEST_DECODE_THREADS: 0
PH_LIGHT_ACTION: 1
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 @@ -66,7 +66,7 @@ jobs:
Get-ChildItem -Path $Env:MSYS2_PREFIX/bin -Force | Format-List
cp ${{ env.MSYS2_PREFIX }}/bin/libheif.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libde265-0.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libx265*.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libx265-209.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libaom.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libwinpthread-1.dll $site_packages/
cp ${{ env.MSYS2_PREFIX }}/bin/libgcc_s_seh-1.dll $site_packages/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-pillow_heif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
Get-ChildItem -Path $Env:MSYS2_PREFIX/bin -Force | Format-List
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libheif.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libde265-0.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libx265.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libx265-209.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libaom.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libwinpthread-1.dll
${{ env.MSYS2_PREFIX }}/bin/strip -s -v ${{ env.MSYS2_PREFIX }}/bin/libgcc_s_seh-1.dll
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
All notable changes to this project will be documented in this file.

## [0.21.0 - 2024-1x-xx]

### Changed

- libheif updated from `1.18.2` to `1.19.3` version.

## [0.20.0 - 2024-10-19]

### Added
Expand Down
1 change: 0 additions & 1 deletion docker/from_src/Alpine_3_19.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN \
nasm \
aom-dev \
x265-dev \
libde265-dev \
py3-numpy \
py3-pillow

Expand Down
7 changes: 6 additions & 1 deletion docker/from_src/Alpine_3_20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ RUN \
python3-dev \
py3-pip \
alpine-sdk \
libheif-dev \
cmake \
nasm \
aom-dev \
x265-dev \
libde265-dev \
py3-numpy \
py3-pillow

Expand All @@ -16,6 +20,7 @@ COPY . /pillow_heif
RUN \
python3 -m venv --system-site-packages myenv && \
source myenv/bin/activate && \
python3 pillow_heif/libheif/linux_build_libs.py && \
if [ `getconf LONG_BIT` = 64 ]; then \
python3 -m pip install -v "pillow_heif/.[tests]"; \
else \
Expand Down
Loading

0 comments on commit 4c16779

Please sign in to comment.