Django,sorl-thumbnail裁剪图片头 [英] Django, sorl-thumbnail crop picture head
问题描述
谢谢
我刚刚发布了一个新版本由btol45的答案灵感来自边缘和智能裁剪的sorl-thumbnail(3.2.5)。
引用文档:
默认情况下,图像在裁剪前居中。要从
边缘裁剪,请传递一个逗号分隔的字符串,其中包含x
和y
百分比偏移量(负值从右侧/底部)。一些
的例子如下:
crop =0,0
将从左边和上边缘裁剪。
crop = - 10,-0
将从正确的边缘(10%的偏移量)和
的边缘裁剪。
crop = ,0
将保持x轴的默认行为(水平
以图像为中心),并从上边缘裁剪。
图像也可以通过使用
crop =smart
进行智能裁剪。图像
通过从最小熵的边删除切片
,逐渐裁剪到所请求的大小。
guys, i would like to know if sorl-thumbnail have any option to crop from the bottom to the top... i have a litter problem, in some picture sorl-thumbnail is croping the head of the people in pictures.
Thanks
I've just released a new version of sorl-thumbnail (3.2.5) with cropping from edge and smart cropping inspired by btol45's answer.
Quoting the docs:
By default, the image is centered before being cropped. To crop from the edges, pass a comma separated string containing the
x
andy
percentage offsets (negative values go from the right/bottom). Some examples follow:
crop="0,0"
will crop from the left and top edges.
crop="-10,-0"
will crop from the right edge (with a 10% offset) and the bottom edge.
crop=",0"
will keep the default behavior for the x axis (horizontally centering the image) and crop from the top edge.The image can also be "smart cropped" by using
crop="smart"
. The image is incrementally cropped down to the requested size by removing slices from edges with the least entropy.
这篇关于Django,sorl-thumbnail裁剪图片头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!