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

If the size of the img element is less than the natural size of the image, the result is cropped #1

Open
SimonChris opened this issue Sep 23, 2017 · 2 comments

Comments

@SimonChris
Copy link

When applying effects to an img element, if the size of the element is less than the natural size of the image, the result is cropped.

@aurbano
Copy link
Owner

aurbano commented Sep 25, 2017

Hmm, I believe it's getting the size via JS from the element, which probably reports the current size, not the image's true size.

A quick google search says that we should use img.naturalWidth and img.naturalHeight, could use a PR if you have the time to go over this :)

@SimonChris
Copy link
Author

I did actually try to use the naturalWidth/Height solution, but I couldn't make it work... I managed to make a workaround where I render an invisible picture with natural size, apply the effect to that, and send the result to the smaller picture. I probably won't have time to look more at this any time soon.

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

No branches or pull requests

2 participants