Fix image scale issue in thumbnail creation#793
Merged
Conversation
Closed
prabhuamol
commented
Jul 8, 2024
| func makeImage() -> PlatformImage? { | ||
| if let thumbnail { | ||
| return makeThumbnail(data: data, options: thumbnail) | ||
| return makeThumbnail(data: data, |
Author
There was a problem hiding this comment.
use scale in creating a thumbnail similar to how ImageDecoders.Default._decode(data, scale: scale) is using it below
more tests use scale make scale non optional docs
prabhuamol
commented
Jul 9, 2024
| } | ||
|
|
||
| #if canImport(UIKit) | ||
| let orientation: UIImage.Orientation |
Author
There was a problem hiding this comment.
this is needed to make sure the returned image has the same orientation as the original. Verified via tests below with .right and .up orientation images
Owner
|
Hey, thanks @prabhuamol. I think it looks really good now. |
Owner
|
I will update the tests in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Potential fix for #791 Also makes sure resized images have the same orientation as the original image
Also renamed the image which was right oriented correctly