From ac62312ceb41c9ce44107f1c87a301dd60d6b628 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:42:06 +0300 Subject: [PATCH] disabled plugins loading (#206) Signed-off-by: Alexander Piskun --- CHANGELOG.md | 3 +-- libheif/linux_build_libs.py | 2 +- libheif/macos/libheif.rb | 2 +- libheif/windows/mingw-w64-libheif/PKGBUILD | 2 +- pi-heif/libheif/macos/libheif.rb | 2 +- pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD | 2 +- pillow_heif/__init__.py | 2 +- pillow_heif/misc.py | 2 +- tests/basic_test.py | 4 ++-- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0fc1de..193c85e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ All notable changes to this project will be documented in this file. -## [0.15.0 - 2024-02-02] +## [0.15.0 - 2024-02-03] ### Added - `libheif_info` function: added `encoders` and `decoders` keys to the result, for future libheif plugins support. #189 - `options.PREFERRED_ENCODER` - to use `encoder` different from the default one. #192 - `options.PREFERRED_DECODER` - to use `decoder` different from the default one. #193 -- New `load_plugin` function. `ENABLE_PLUGIN_LOADING` option now is `ON` in the libheif configuration. #154 ### Changed diff --git a/libheif/linux_build_libs.py b/libheif/linux_build_libs.py index 6caf1cfa..f513a4d9 100644 --- a/libheif/linux_build_libs.py +++ b/libheif/linux_build_libs.py @@ -209,7 +209,7 @@ def build_lib_linux(url: str, name: str): "-DWITH_JPEG_ENCODER=OFF " "-DWITH_OpenJPEG_DECODER=OFF " "-DWITH_OpenJPEG_ENCODER=OFF " - "-DENABLE_PLUGIN_LOADING=ON " + "-DENABLE_PLUGIN_LOADING=OFF " "-DWITH_LIBSHARPYUV=OFF " "-DWITH_EXAMPLES=OFF".split() ) diff --git a/libheif/macos/libheif.rb b/libheif/macos/libheif.rb index 0ce78dae..404b6338 100644 --- a/libheif/macos/libheif.rb +++ b/libheif/macos/libheif.rb @@ -42,7 +42,7 @@ def install -DWITH_JPEG_ENCODER=OFF -DWITH_OpenJPEG_DECODER=OFF -DWITH_OpenJPEG_ENCODER=OFF - -DENABLE_PLUGIN_LOADING=ON + -DENABLE_PLUGIN_LOADING=OFF -DWITH_LIBSHARPYUV=OFF -DCMAKE_INSTALL_RPATH=#{rpath} ] diff --git a/libheif/windows/mingw-w64-libheif/PKGBUILD b/libheif/windows/mingw-w64-libheif/PKGBUILD index 140f4774..5642700b 100644 --- a/libheif/windows/mingw-w64-libheif/PKGBUILD +++ b/libheif/windows/mingw-w64-libheif/PKGBUILD @@ -57,7 +57,7 @@ build() { -DWITH_JPEG_ENCODER=OFF \ -DWITH_OpenJPEG_DECODER=OFF \ -DWITH_OpenJPEG_ENCODER=OFF \ - -DENABLE_PLUGIN_LOADING=ON \ + -DENABLE_PLUGIN_LOADING=OFF \ -DWITH_LIBSHARPYUV=OFF \ -DWITH_EXAMPLES=OFF \ -DX265_CFLAGS="-DX265_API_IMPORTS" \ diff --git a/pi-heif/libheif/macos/libheif.rb b/pi-heif/libheif/macos/libheif.rb index e62056f5..3670573d 100644 --- a/pi-heif/libheif/macos/libheif.rb +++ b/pi-heif/libheif/macos/libheif.rb @@ -37,7 +37,7 @@ def install -DWITH_JPEG_ENCODER=OFF -DWITH_OpenJPEG_DECODER=OFF -DWITH_OpenJPEG_ENCODER=OFF - -DENABLE_PLUGIN_LOADING=ON + -DENABLE_PLUGIN_LOADING=OFF -DWITH_LIBSHARPYUV=OFF -DWITH_EXAMPLES=OFF -DCMAKE_INSTALL_RPATH=#{rpath} diff --git a/pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD b/pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD index 48291edb..01117f8b 100644 --- a/pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD +++ b/pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD @@ -54,7 +54,7 @@ build() { -DWITH_JPEG_ENCODER=OFF \ -DWITH_OpenJPEG_DECODER=OFF \ -DWITH_OpenJPEG_ENCODER=OFF \ - -DENABLE_PLUGIN_LOADING=ON \ + -DENABLE_PLUGIN_LOADING=OFF \ -DWITH_LIBSHARPYUV=OFF \ -DWITH_EXAMPLES=OFF \ ../${_realname}-${pkgver} diff --git a/pillow_heif/__init__.py b/pillow_heif/__init__.py index 35ffa8e2..4fd5be4a 100644 --- a/pillow_heif/__init__.py +++ b/pillow_heif/__init__.py @@ -26,4 +26,4 @@ open_heif, read_heif, ) -from .misc import get_file_mimetype, load_plugin, set_orientation +from .misc import get_file_mimetype, load_libheif_plugin, set_orientation diff --git a/pillow_heif/misc.py b/pillow_heif/misc.py index 47631384..5d626f34 100644 --- a/pillow_heif/misc.py +++ b/pillow_heif/misc.py @@ -448,6 +448,6 @@ def bit_depth(self) -> int: return MODE_INFO[self.mode][1] -def load_plugin(plugin_path: Union[str, Path]) -> None: +def load_libheif_plugin(plugin_path: Union[str, Path]) -> None: """Load specified LibHeif plugin.""" _pillow_heif.load_plugin(plugin_path) diff --git a/tests/basic_test.py b/tests/basic_test.py index e8ae5525..0089b17d 100644 --- a/tests/basic_test.py +++ b/tests/basic_test.py @@ -130,6 +130,6 @@ def test_light_build(): @pytest.mark.skipif(not os.getenv("TEST_PLUGIN_LOAD"), reason="Only when plugins present") def test_load_plugin(): - pillow_heif.load_plugin(os.environ["TEST_PLUGIN_LOAD"]) + pillow_heif.load_libheif_plugin(os.environ["TEST_PLUGIN_LOAD"]) with pytest.raises(RuntimeError): - pillow_heif.load_plugin("invalid path") + pillow_heif.load_libheif_plugin("invalid path")