october-mediathumb icon indicating copy to clipboard operation
october-mediathumb copied to clipboard

Added cropping

Open Dobbler opened this issue 8 years ago • 5 comments

Crop can be called like so: {{ 'image_name.jpg'|mediathumb_resize('crop', '$my_width|$my_height', $my_quality) }} e.g: {{ 'image_name.jpg'|mediathumb_resize('crop', '1200|500', 70) }}

Separate width and height with pipe (|) in quotes. It uses Intervention's "fit" as opposed to "crop" to make the best fit to the dimensions.

Dobbler avatar Nov 12 '16 12:11 Dobbler

Had a bit of a brain fart with the first pull request.. this should do the trick..

Dobbler avatar Nov 12 '16 12:11 Dobbler

Yeah great - now I will look into it, thanks for contributing. I will work on this over the weekend and add it one way or another. Until now I was planning to add a second method "mediathumb_crop", so I will have to decide if I want to keep that idea or put it all in one method. I will keep you posted here.

bastihilger avatar Nov 12 '16 12:11 bastihilger

Cool, to be honest, it was a bit quick and nasty to get me through this particular project so it may not be the best solution. Thanks for the plugin, saved me a tonne of time! Cheers!

Dobbler avatar Nov 12 '16 12:11 Dobbler

+1 crop would be awesome.

that0n3guy avatar May 03 '17 16:05 that0n3guy

I'm just following up on this request. Will the cropping feature be added in the near future? This feature would be helpful.

daykinandstorey avatar Jun 21 '18 12:06 daykinandstorey