Skip to content

Commit ed55cbb

Browse files
committed
Add pillow-avif-plugin for AVIF support
1 parent 049bec1 commit ed55cbb

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ numpy>=1.18.5
77
opencv-python-headless==4.10.0.84
88
Pillow>=7.1.2
99
# https://github.com/roboflow/roboflow-python/issues/390
10-
pillow-heif<1
10+
pillow-heif<2
11+
pillow-avif-plugin
1112
python-dateutil
1213
python-dotenv
1314
requests

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from roboflow.models import CLIPModel, GazeModel # noqa: F401
1616
from roboflow.util.general import write_line
1717

18-
__version__ = "1.1.67"
18+
__version__ = "1.1.68"
1919

2020

2121
def check_key(api_key, model, notebook, num_retries=0):

roboflow/util/image_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
import os
55
import urllib
66

7+
import pillow_avif # type: ignore[import-untyped]
8+
79
# Third-party imports
810
import pillow_heif # type: ignore[import-untyped]
911
import requests
1012
import yaml
1113
from PIL import Image
1214

1315
pillow_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC
14-
pillow_heif.register_avif_opener(thumbnails=False) # Register for AVIF
16+
pillow_avif.register_avif_opener() # Register for AVIF
1517

1618

1719
def check_image_path(image_path):

tests/test_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def test_check_valid_image_with_accepted_formats(self):
8585
"woodland-rabbit.png",
8686
"file_example_TIFF_1MB.tiff",
8787
"sky-rabbit.heic",
88+
"whatsnew.avif",
8889
]
8990

9091
for image in images_to_test:

0 commit comments

Comments
 (0)