【发布时间】:2014-12-12 22:03:50
【问题描述】:
我一直在使用 Django-Filebrowser 并设置我的版本 as specified in the docs,这表明您指定图像版本如下:
VERSIONS = getattr(settings, "FILEBROWSER_VERSIONS", {
'thumbnail': {'verbose_name': 'Thumbnail (1 col)', 'width': 60, 'height': 60, 'opts': 'crop'},
'small': {'verbose_name': 'Small (2 col)', 'width': 140, 'height': '', 'opts': ''},
})
...请注意具有未指定高度的“小”版本大小,它成功生成了具有约束宽度和自动高度的图像版本。这对我来说很成功,但是反过来却不行(限制高度但自动宽度):
'auto_width': {'verbose_name': 'Auto Width', 'width': '', 'height': 140, 'opts': ''},
这里有没有我遗漏的技巧,或者图书馆没有这个能力?
【问题讨论】: