Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for _heif in imageformats plugin #816

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions vimiv/plugins/imageformats.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,23 @@
return h[4:12] in (b"ftypavif", b"ftypavis")


def _test_heif(h: bytes, _f: BinaryIO) -> bool:
"""HEIF High Efficiency Image File Format.

Extension: .heif

Magic bytes:
- 66 74 79 70 68 65 69 63

Support: qt-heif-image-plugin https://github.com/jakar/qt-heif-image-plugin
"""
return h[4:12] == b"ftypheic"

Check warning on line 74 in vimiv/plugins/imageformats.py

View check run for this annotation

Codecov / codecov/patch

vimiv/plugins/imageformats.py#L74

Added line #L74 was not covered by tests


FORMATS = {
"cr2": _test_cr2,
"avif": _test_avif,
"heif": _test_heif,
}


Expand Down