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

Optional attribute to prevent small images from being stretched #134

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

Optional attribute to prevent small images from being stretched #134

wants to merge 1 commit into from

Conversation

mbertram
Copy link

If the original image's dimensions are smaller than the value of the result-image-size attribute, the cropped image will be scaled up. Sometimes this might not be the intended behaviour. I added the attribute dont-stretch-smaller-images which stops that behaviour. If the image is smaller than result-image-size then the original image size is used for the cropped image.

This pull request exposes the solution described in #78 through an optional attribute on the ng-img-crop directive.

Adds an optional attribute that prevents the result image to be stretched in case it is smaller than result-image-size.
Copy link

@cgaggino cgaggino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be a nice feature to add. I'll be using this repo in the meantime

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.

2 participants