Skip to content

Fix #390: Lock pillow-hief version to not break AVIF support#391

Merged
iurisilvio merged 3 commits intoroboflow:mainfrom
MuhammadHadiofficial:main
Jun 30, 2025
Merged

Fix #390: Lock pillow-hief version to not break AVIF support#391
iurisilvio merged 3 commits intoroboflow:mainfrom
MuhammadHadiofficial:main

Conversation

@MuhammadHadiofficial
Copy link
Copy Markdown
Contributor

@MuhammadHadiofficial MuhammadHadiofficial commented Jun 29, 2025

Description

Roboflow doesn't bound the pillow-hief version, resulting in the following errors when installed on Colab and kaggle notebooks:

     12 
     13 pillow_heif.register_heif_opener(thumbnails=False)  # Register for HEIF/HEIC
---> 14 pillow_heif.register_avif_opener(thumbnails=False)  # Register for AVIF
     15 
     16 

AttributeError: module 'pillow_heif' has no attribute 'register_avif_opener'

List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested, please provide a testcase or example of how you tested the change?

Tests pass.

Tested manually that 0.22 works (with a deprecation notice).

>>> from PIL import Image
>>> import pillow_heif
>>> pillow_heif.__version__
'0.22.0'
>>> pillow_heif.register_avif_opener()
<stdin>:1: DeprecationWarning: 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.
>>> Image.open("fox.profile0.10bpc.yuv420.avif")
<pillow_heif.as_plugin.AvifImageFile image mode=RGB size=1204x800 at 0xFFFFB34C9F10>

Any specific deployment considerations

None

@iurisilvio iurisilvio self-requested a review June 30, 2025 07:51
@iurisilvio iurisilvio self-assigned this Jun 30, 2025
@PacificDou PacificDou self-requested a review June 30, 2025 07:54
Copy link
Copy Markdown
Contributor

@PacificDou PacificDou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iurisilvio iurisilvio changed the title fix: lock pillow-hief version and bump version Fix #390: lock pillow-hief version and bump version Jun 30, 2025
@iurisilvio iurisilvio changed the title Fix #390: lock pillow-hief version and bump version Fix #390: Lock pillow-hief version to not break AVIF support Jun 30, 2025
@iurisilvio iurisilvio merged commit 049bec1 into roboflow:main Jun 30, 2025
13 checks passed
@iurisilvio
Copy link
Copy Markdown
Contributor

Thank you @MuhammadHadiofficial for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants