Skip to content

Commit

Permalink
added deprecation note about AVIF support
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Dec 29, 2024
1 parent cfe2a32 commit 7b7105b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
Python bindings to [libheif](https://github.com/strukturag/libheif) for working with HEIF images and plugin for Pillow.

Features:
* Decoding of `8`, `10`, `12` bit HEIC and AVIF files.
* Encoding of `8`, `10`, `12` bit HEIC and AVIF files.
* Decoding of `8`, `10`, `12` bit HEIC files.
* Encoding of `8`, `10`, `12` bit HEIC files.
* `EXIF`, `XMP`, `IPTC` read & write support.
* Support of multiple images in one file and a `PrimaryImage` attribute.
* Adding & removing `thumbnails`.
Expand Down Expand Up @@ -97,15 +97,6 @@ if pillow_heif.is_supported("input.heic"):
np_array = np.asarray(heif_file)
```

### AVIF support

Working with the `AVIF` files as the same as with the `HEIC` files. Just use a separate function to register plugin:
```python3
import pillow_heif

pillow_heif.register_avif_opener()
```

### Accessing Depth Images

```python3
Expand Down
2 changes: 2 additions & 0 deletions docs/pillow-plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ AVIF plugin
``AVIF`` plugin should support all operations and work the same way as ``HEIF`` plugin do.

.. note:: Deprecated, use the `pillow-avif-plugin <https://github.com/fdintino/pillow-avif-plugin>`_ project instead.

Tips & Tricks
"""""""""""""

Expand Down
7 changes: 7 additions & 0 deletions pillow_heif/as_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ def register_avif_opener(**kwargs) -> None:
:param kwargs: dictionary with values to set in options. See: :ref:`options`.
"""
warn(
"The AVIF support in this library is marked as deprecated and will be removed in the next version. "
"If you still need AVIF support until it natively appears in Pillow, use the "
"https://github.com/fdintino/pillow-avif-plugin project instead.",
DeprecationWarning,
stacklevel=2,
)
if not _pillow_heif.get_lib_info()["AVIF"]:
warn("This version of `pillow-heif` was built without AVIF support.", stacklevel=1)
return
Expand Down

0 comments on commit 7b7105b

Please sign in to comment.