Skip to content

Commit 4366788

Browse files
authored
feat(libheif): update packages versions, drop ALLOW_INCORRECT_HEADERS option (#426)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
1 parent fa424a0 commit 4366788

24 files changed

Lines changed: 52 additions & 255 deletions

.github/workflows/analysis-coverage.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ jobs:
3232
python-version: '3.12'
3333

3434
- name: Install Libheif
35-
run: brew install libheif
35+
run: |
36+
brew update
37+
brew install libheif
3638
3739
- name: Install from source
3840
run: python3 -m pip install ".[dev]" wheel setuptools
@@ -146,7 +148,9 @@ jobs:
146148
python-version: '3.10'
147149

148150
- name: Install Libheif
149-
run: brew install libheif
151+
run: |
152+
brew update
153+
brew install libheif
150154
151155
- name: Install from source
152156
run: python3 -m pip -v install ".[dev]"
@@ -185,7 +189,9 @@ jobs:
185189
python-version: '3.11'
186190

187191
- name: Install Libheif
188-
run: brew install libheif
192+
run: |
193+
brew update
194+
brew install libheif
189195
190196
- name: Install from source
191197
run: python3 -m pip -v install ".[dev]"
@@ -386,7 +392,9 @@ jobs:
386392
python-version: '3.12'
387393

388394
- name: Install Libheif
389-
run: brew install libheif
395+
run: |
396+
brew update
397+
brew install libheif
390398
391399
- name: Install from source
392400
run: |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
docker_file: ["Alpine_3_20", "Alpine_3_21", "Almalinux_9", "Debian_12"]
36+
docker_file: ["Alpine_3_21", "Alpine_3_22", "Almalinux_9", "Debian_12"]
3737

3838
steps:
3939
- uses: actions/checkout@v6
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
docker_file: ["Alpine_3_20", "Alpine_3_21", "Almalinux_9", "Debian_12"]
72+
docker_file: ["Alpine_3_21", "Alpine_3_22", "Almalinux_9", "Debian_12"]
7373

7474
steps:
7575
- uses: actions/checkout@v6

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
All notable changes to this project will be documented in this file.
22

3+
## [1.4.0 - 2026-05-30]
4+
5+
### Changed
6+
7+
- `libheif` was updated from the `1.21.2` to `1.23.0` version. #426
8+
- `libde265` was updated from the `1.0.16` to `1.1.0` version. #426
9+
- `libx265` was updated from the `4.1` to `4.2` version. #426
10+
11+
### Removed
12+
13+
- `options.ALLOW_INCORRECT_HEADERS` option. Starting with `libheif` `1.22.0`, libheif itself rejects images whose decoded size does not match the `ispe` header. #426
14+
315
## [1.3.0 - 2026-02-27]
416

517
### Added

docker/from_src/Alpine_3_21.Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
FROM alpine:3.21 as base
1+
FROM alpine:3.20 as base
22

33
RUN \
44
apk add --no-cache \
55
python3-dev \
66
py3-pip \
77
alpine-sdk \
8-
libheif-dev \
8+
cmake \
9+
nasm \
10+
x265-dev \
11+
libde265-dev \
912
py3-numpy \
1013
py3-pillow
1114

@@ -16,6 +19,7 @@ COPY . /pillow_heif
1619
RUN \
1720
python3 -m venv --system-site-packages myenv && \
1821
source myenv/bin/activate && \
22+
python3 pillow_heif/libheif/build_libs.py && \
1923
python3 -m pip install -v "pillow_heif/.[tests]"; \
2024
echo "**** Build Done ****" && \
2125
python3 -c "import pillow_heif; print(pillow_heif.libheif_info())" && \
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
FROM alpine:3.20 as base
1+
FROM alpine:3.21 as base
22

33
RUN \
44
apk add --no-cache \
55
python3-dev \
66
py3-pip \
77
alpine-sdk \
8-
cmake \
9-
nasm \
10-
x265-dev \
11-
libde265-dev \
8+
libheif-dev \
129
py3-numpy \
1310
py3-pillow
1411

@@ -19,7 +16,6 @@ COPY . /pillow_heif
1916
RUN \
2017
python3 -m venv --system-site-packages myenv && \
2118
source myenv/bin/activate && \
22-
python3 pillow_heif/libheif/build_libs.py && \
2319
python3 -m pip install -v "pillow_heif/.[tests]"; \
2420
echo "**** Build Done ****" && \
2521
python3 -c "import pillow_heif; print(pillow_heif.libheif_info())" && \

docs/options.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Options
88
.. autodata:: pillow_heif.options.DEPTH_IMAGES
99
.. autodata:: pillow_heif.options.QUALITY
1010
.. autodata:: pillow_heif.options.SAVE_HDR_TO_12_BIT
11-
.. autodata:: pillow_heif.options.ALLOW_INCORRECT_HEADERS
1211
.. autodata:: pillow_heif.options.SAVE_NCLX_PROFILE
1312
.. autodata:: pillow_heif.options.PREFERRED_ENCODER
1413
.. autodata:: pillow_heif.options.PREFERRED_DECODER

libheif/build_libs.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
PH_LIGHT_VERSION = sys.maxsize <= 2**32 or getenv("PH_LIGHT_ACTION", "0") != "0"
1919

20-
LIBX265_URL = "https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz"
21-
LIBDE265_URL = "https://github.com/strukturag/libde265/releases/download/v1.0.16/libde265-1.0.16.tar.gz"
22-
LIBHEIF_URL = "https://github.com/strukturag/libheif/releases/download/v1.21.2/libheif-1.21.2.tar.gz"
20+
LIBX265_URL = "https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.2.tar.gz"
21+
LIBDE265_URL = "https://github.com/strukturag/libde265/releases/download/v1.1.0/libde265-1.1.0.tar.gz"
22+
LIBHEIF_URL = "https://github.com/strukturag/libheif/releases/download/v1.23.0/libheif-1.23.0.tar.gz"
2323

2424

2525
def download_file(url: str, out_path: str) -> bool:
@@ -154,8 +154,6 @@ def build_lib(url: str, name: str):
154154
if name == "x265":
155155
download_extract_to(url, lib_path)
156156
chdir(lib_path)
157-
run(f"patch -p 1 -i {path.join(script_dir, 'x265_cmake_1.patch')}".split(), check=True)
158-
run(f"patch -p 1 -i {path.join(script_dir, 'x265_cmake_2.patch')}".split(), check=True)
159157
else:
160158
build_path = path.join(lib_path, "build")
161159
makedirs(build_path, exist_ok=True)

libheif/windows/mingw-w64-libheif/PKGBUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
_realname=libheif
55
pkgbase=mingw-w64-${_realname}
66
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
7-
pkgver=1.21.2
7+
pkgver=1.23.0
88
pkgrel=1
99
pkgdesc="HEIF image decoder/encoder library and tools (mingw-w64)"
1010
arch=('any')
@@ -22,7 +22,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
2222
"${MINGW_PACKAGE_PREFIX}-libde265"
2323
"${MINGW_PACKAGE_PREFIX}-x265")
2424
source=("https://github.com/strukturag/libheif/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz")
25-
sha256sums=('75f530b7154bc93e7ecf846edfc0416bf5f490612de8c45983c36385aa742b42')
25+
sha256sums=('4c9182b18897617182eed12ab5eb9f9d855b3aa3a736d6bdb31abc034ec7d393')
2626

2727
build() {
2828
mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}

libheif/x265_cmake_1.patch

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

libheif/x265_cmake_2.patch

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

0 commit comments

Comments
 (0)