问题描述
我想在 djangocms-picture 插件中设置默认的最大图像尺寸。 我想在模板级别执行此操作。
这个简单的模板例如:
{% load thumbnail %}
<img src="{% thumbnail instance.img_src 'golden_ratio_xlarge' %}">
出现此错误:
SuspicIoUsFileOperation at /en/
The joined path (/media/filer_public_thumbnails/filer_public/a3/07/a3073ea1-a798-43c0-869f-689de5f53e7e/sawa.png__420x233_q85_subsampling-2.png) is located outside of the base path component (/home/mogoh/src/git.noc.ruhr-uni-bochum.de/ceres/website/ceres/media)
解决方法
我已经解决了这个问题。
重要事项
- 设置正确的插件上下文:http://docs.django-cms.org/en/latest/how_to/custom_plugins.html?highlight=width#plugin-context
- 确保图片使用“自动缩放”。
- 请勿直接使用
tumbnails
插件。