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 hea
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.