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

feat: Support HEIF, HEIC and AVIF recipe image uploads #3409

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
5 changes: 4 additions & 1 deletion mealie/pkgs/img/minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
from logging import Logger
from pathlib import Path

from pi_heif import register_heif_opener
from PIL import Image

register_heif_opener()

WEBP = ".webp"
FORMAT = "WEBP"

IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp"}
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp", ".heic", ".avif"}
michael-genson marked this conversation as resolved.
Show resolved Hide resolved


def get_format(image: Path) -> str:
Expand Down
1 change: 1 addition & 0 deletions mealie/pkgs/img/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
".dib",
".heif",
".heic",
".avif",
".ind",
".jp2",
".svg",
Expand Down
86 changes: 85 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ authlib = "^1.3.0"
html2text = "^2024.0.0"
paho-mqtt = "^1.6.1"
pydantic-settings = "^2.1.0"
pi-heif = "^0.16.0"

[tool.poetry.group.postgres.dependencies]
psycopg2-binary = { version = "^2.9.1" }
Expand Down
Loading