Skip to content

Commit 53c41ba

Browse files
authored
Use pillow-avif-plugin for AVIF support and support pillow-heif 1.0 (#392)
1 parent 049bec1 commit 53c41ba

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: ["ubuntu-latest", "windows-latest"]
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1515
runs-on: ${{ matrix.os }}
1616
env:
1717
PYTHONUTF8: 1

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<2
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.2.0"
1919

2020

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

roboflow/util/image_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import urllib
66

77
# Third-party imports
8+
import pillow_avif # type: ignore[import-untyped]
89
import pillow_heif # type: ignore[import-untyped]
910
import requests
1011
import yaml
1112
from PIL import Image
1213

1314
pillow_heif.register_heif_opener(thumbnails=False) # Register for HEIF/HEIC
14-
pillow_heif.register_avif_opener(thumbnails=False) # Register for AVIF
15+
pillow_avif = pillow_avif # Reference pillow_avif to not remove import by accident
1516

1617

1718
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)