Skip to content

Added cropping#11

Open
Dobbler wants to merge 1 commit intobastihilger:masterfrom
Dobbler:master
Open

Added cropping#11
Dobbler wants to merge 1 commit intobastihilger:masterfrom
Dobbler:master

Conversation

@Dobbler
Copy link
Copy Markdown

@Dobbler Dobbler commented Nov 12, 2016

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.

Crop can be called like so: {{ 'image_name.jpg'|mediathumb_resize('crop', 'WIDTH|HEIGHT', QUALITY) }}
@Dobbler
Copy link
Copy Markdown
Author

Dobbler commented Nov 12, 2016

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

@bastihilger
Copy link
Copy Markdown
Owner

bastihilger commented Nov 12, 2016

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.

@Dobbler
Copy link
Copy Markdown
Author

Dobbler commented Nov 12, 2016

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!

@that0n3guy
Copy link
Copy Markdown

+1 crop would be awesome.

@daykinandstorey
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants