mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 20:37:42 +00:00
preview heic img (#6700)
* preview heic img * update * Update requirements.txt * Update utils.py * Update requirements.txt * update --------- Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com> Co-authored-by: r350178982 <32759763+r350178982@users.noreply.github.com>
This commit is contained in:
@@ -130,7 +130,7 @@ export const Utils = {
|
||||
return false;
|
||||
}
|
||||
var file_ext = filename.substr(filename.lastIndexOf('.') + 1).toLowerCase();
|
||||
var image_exts = ['gif', 'jpeg', 'jpg', 'png', 'ico', 'bmp', 'tif', 'tiff', 'jfif'];
|
||||
var image_exts = ['gif', 'jpeg', 'jpg', 'png', 'ico', 'bmp', 'tif', 'tiff', 'jfif', 'heic'];
|
||||
if (image_exts.indexOf(file_ext) != -1) {
|
||||
return true;
|
||||
} else {
|
||||
|
@@ -28,3 +28,4 @@ python-ldap==3.4.*
|
||||
pypinyin==0.52.*
|
||||
PyMuPDF==1.24.*
|
||||
dnspython==2.6.*
|
||||
pillow-heif==0.18.*
|
||||
|
@@ -15,6 +15,7 @@ except:
|
||||
from urllib.request import urlretrieve
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from seaserv import get_file_id_by_path, get_repo, get_file_size, \
|
||||
seafile_api
|
||||
|
||||
@@ -23,6 +24,12 @@ from seahub.utils.file_types import VIDEO, XMIND, PDF
|
||||
from seahub.settings import THUMBNAIL_IMAGE_SIZE_LIMIT, \
|
||||
THUMBNAIL_EXTENSION, THUMBNAIL_ROOT, THUMBNAIL_IMAGE_ORIGINAL_SIZE_LIMIT,\
|
||||
ENABLE_VIDEO_THUMBNAIL, THUMBNAIL_VIDEO_FRAME_TIME
|
||||
try:
|
||||
from pillow_heif import register_heif_opener
|
||||
register_heif_opener()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Get an instance of a logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
Reference in New Issue
Block a user