Use percent orig width/height for down scaling #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change better respects the users configured max width and height values when rendering an image. Addressing #19
higher level overview of how
When down-scaling images, we crush the image to the max height and width, and then attempt to restore the aspect ratio. When restoring the aspect ration, we now take the percentage of the original dimension (either width or height) that's smaller, keep that smaller value, and scale the other to match.
This should always be more accurate than what we were previously doing, which was just keeping the larger value and scaling the smaller value to match.