We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
aom
1 parent 45307c1 commit 9ad6dfeCopy full SHA for 9ad6dfe
pillow_heif/as_opener.py
@@ -3,6 +3,7 @@
3
"""
4
5
from typing import Any
6
+from warnings import warn
7
8
from PIL import Image, ImageFile
9
@@ -183,6 +184,11 @@ def register_avif_opener(**kwargs) -> None:
183
184
:param kwargs: dictionary with values to set in :py:class:`~pillow_heif._options.PyLibHeifOptions`
185
186
187
+ if not have_decoder_for_format(HeifCompressionFormat.AV1) and not have_encoder_for_format(
188
+ HeifCompressionFormat.AV1
189
+ ):
190
+ warn("This version of `pillow-heif` was built without AVIF support.")
191
+ return
192
options().update(**kwargs)
193
if have_decoder_for_format(HeifCompressionFormat.AV1):
194
Image.register_open(AvifImageFile.format, AvifImageFile, _is_supported_avif)
0 commit comments