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

Downsampler.AT_MOST is broken. #434

Closed
sjudd opened this issue Apr 22, 2015 · 1 comment
Closed

Downsampler.AT_MOST is broken. #434

sjudd opened this issue Apr 22, 2015 · 1 comment
Labels
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Apr 22, 2015

Instead of max(sourceWidth / targetWidth, sourceHeight / targetHeight), it should be max(ceil(sourceWidth / (float) targetWidth), ceil(sourceHeight / (float) targetHeight)).

The description is also inaccurate. The largest edge of the image will be between 1x and 1/2x the requested size, the smaller edge may be considerably smaller than 1/2x the requested size.

@sjudd sjudd added the bug label Apr 22, 2015
@sjudd sjudd added this to the 3.6.0 milestone Apr 22, 2015
@TWiStErRob
Copy link
Collaborator

You can save a ceil by: ceil(max(*, *))

sjudd added a commit to sjudd/glide that referenced this issue Apr 23, 2015
sjudd added a commit to sjudd/glide that referenced this issue Apr 26, 2015
@sjudd sjudd closed this as completed in dc93f1f Apr 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants