https://twill.io logo
Auto cropping
# ❓questions
n
Can the image auto cropping feature be customized or adjusted?
i
Please clarify. What do you want to change?
n
when we add a wider image, it auto crops it, and usually the right side of it is gone. Can I somehow automatically crop it in the center?
so it would make the cropped out part less
i
We're using smartcrop.js which is trying to find the most relevant part of the image. I'd be curious to see an example image that doesn't work for you. This is where the smart cropping is applied https://github.com/area17/twill/blob/61f34bd011d115e490329d0e24b220de491bcd53/frontend/js/components/MediaField.vue#L355 It seems like you would want to replace it by something simpler that is just doing a centered crop.
n
I can send an example
I just readded the image so it automatically crops it, and thats what it did
i
I guess the trees are confusing the algo haha
n
it could be, it looks relevant 😅
n
yeah
its the exact same thing
opencv does the same in reverse
i
Did you try with a face API enabled?
n
someone is hiding on that tree
i
hahaha
n
yes, it looks just like "Off"
3 Views