Support HDR image formats

This commit is contained in:
Leo Vasanko 2025-08-13 10:28:49 -07:00
parent 3a65277994
commit 05cc823e37
3 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,9 @@ from sanic.log import logger
from cista import config
from cista.util.filename import sanitize
import pillow_heif
pillow_heif.register_heif_opener()
bp = Blueprint("preview", url_prefix="/preview")

View File

@ -101,7 +101,7 @@ const video = () => ['mkv', 'mp4', 'webm', 'mov', 'avi'].includes(props.doc.ext)
const audio = () => ['mp3', 'flac', 'ogg', 'aac'].includes(props.doc.ext)
const archive = () => ['zip', 'tar', 'gz', 'bz2', 'xz', '7z', 'rar'].includes(props.doc.ext)
const preview = () => (
['bmp', 'ico', 'tif', 'tiff', 'pdf'].includes(props.doc.ext) ||
['bmp', 'ico', 'tif', 'tiff', 'heic', 'heif', 'pdf', 'epub', 'mobi'].includes(props.doc.ext) ||
props.doc.size > 500000 &&
['avif', 'webp', 'png', 'jpg', 'jpeg'].includes(props.doc.ext)
)

View File

@ -24,6 +24,7 @@ dependencies = [
"natsort",
"pathvalidate",
"pillow",
"pillow-heif>=1.1.0",
"pyjwt",
"pymupdf",
"sanic",