diff --git a/cista/preview.py b/cista/preview.py index c37a4a4..ad007b1 100644 --- a/cista/preview.py +++ b/cista/preview.py @@ -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") diff --git a/frontend/src/components/MediaPreview.vue b/frontend/src/components/MediaPreview.vue index 2a1e9c0..03cdf18 100644 --- a/frontend/src/components/MediaPreview.vue +++ b/frontend/src/components/MediaPreview.vue @@ -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) ) diff --git a/pyproject.toml b/pyproject.toml index 401c9f1..52132f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ "natsort", "pathvalidate", "pillow", + "pillow-heif>=1.1.0", "pyjwt", "pymupdf", "sanic",