mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-22 16:52:56 -05:00
feat: Support HEIF, HEIC and AVIF recipe image uploads (#3409)
* feat: Support HEIF, HEIC and AVIF recipe image uploads * fix: lint import block * fix: avif now included * fix: lint import block
This commit is contained in:
@@ -4,11 +4,15 @@ from logging import Logger
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image
|
||||
from pillow_heif import register_avif_opener, register_heif_opener
|
||||
|
||||
register_heif_opener()
|
||||
register_avif_opener()
|
||||
|
||||
WEBP = ".webp"
|
||||
FORMAT = "WEBP"
|
||||
|
||||
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp"}
|
||||
IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".webp", ".heic", ".avif"}
|
||||
|
||||
|
||||
def get_format(image: Path) -> str:
|
||||
|
||||
@@ -19,6 +19,7 @@ NOT_WEBP = {
|
||||
".dib",
|
||||
".heif",
|
||||
".heic",
|
||||
".avif",
|
||||
".ind",
|
||||
".jp2",
|
||||
".svg",
|
||||
|
||||
Reference in New Issue
Block a user