Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cropping #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added cropping #11

wants to merge 1 commit into from

Conversation

Dobbler
Copy link

@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
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
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
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

+1 crop would be awesome.

@daykinandstorey
Copy link

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