haiwen / seahub

The web end of seafile server.
seafile.com
Other
518 stars 367 forks source link

FILE_PREVIEW_MAX_SIZE not working #2018

Open Guilhem30 opened 6 years ago

Guilhem30 commented 6 years ago

I'm using seafile pro 6.2.9. Modifying the FILE_PREVIEW_MAX_SIZE setting does not work. Previewing a file over 30MB fail. The only log I could find is in the seahub.log file :

2018-02-20 15:58:39,377 [ERROR] seahub.thumbnail.views:77 latest_entry [Errno 2] No such file or directory: '/opt/seafile/seafile-pro-server-6.2.9/seahub/seahub/../../../seahub-data/thumbnail/1024/64e67c776d96d7b7629ef24bff97338a25e97ece'
renfeipeng commented 6 years ago

In pro edition, for preview doc/ppt/excel/pdf, there is another option 'max-size'. The option 'max-size' is setted in seafevents.conf. You can refer to 'https://github.com/haiwen/seafile-docs/blob/master/config/seafevents-conf.md'. AND you need to restart seahub so that your changes take effect.

Guilhem30 commented 6 years ago

We are trying to preview high resolution images. We have tried to modify this max-size parameter too but it's made for other filetypes so we weren't surprised that it didn't work. Is it possible to preview higher than 30MB images with Seafile pro ? If so, we haven't been able to file any error log to tell us why it doesn't work. Thank you for your help.

freeplant commented 6 years ago

I'm afraid it is not possible yet. The limitation of 30MB is written in the code currently.

imwhatiam commented 6 years ago

@Guilhem30 hello, for previewing large size images, try add the following settings to conf/seahub_settings.py

# Seafile only generates thumbnails for images smaller than the following size.
THUMBNAIL_IMAGE_SIZE_LIMIT = 30 # MB

# Default size for picture preview. Enlarge this size can improve the preview quality.
# NOTE: since version 6.1.1
THUMBNAIL_SIZE_FOR_ORIGINAL = 1024

Note, we really don't suggest you set these settings too large, because it will cost many many many memory when generating thumbnail for large images.

this is the manual: https://manual.seafile.com/config/seahub_settings_py.html

Guilhem30 commented 6 years ago

Thanks for the answer imwhatiam but this setting doesn't seem to work