gpt4 book ai didi

Django, sorl-thumbnail 裁剪图片头

转载 作者:行者123 更新时间:2023-12-03 10:28:06 25 4
gpt4 key购买 nike

伙计们,我想知道 sorl-thumbnail 是否有任何选项可以从底部到顶部裁剪...我有一个垃圾问题,在某些图片中 sorl-thumbnail 正在裁剪图片中人的头部。

谢谢

最佳答案

我刚刚发布了一个新版本的 sorl-thumbnail (3.2.5),从 btol45 的答案中获得灵感,从边缘裁剪和智能裁剪。

引用文档:

By default, the image is centered before being cropped. To crop from the edges, pass a comma separated string containing the x and y 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 裁剪图片头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1516736/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com