Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled plugins loading #206

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion libheif/linux_build_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down
2 changes: 1 addition & 1 deletion libheif/macos/libheif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
Expand Down
2 changes: 1 addition & 1 deletion libheif/windows/mingw-w64-libheif/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion pi-heif/libheif/macos/libheif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion pi-heif/libheif/windows/mingw-w64-libheif/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion pillow_heif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pillow_heif/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading