Simplify iOS Image Loading#6
Open
wardellbagby wants to merge 2 commits into
Open
Conversation
- Uses the existing Skia-based "Image.makeFromEncoded" to convert an NSData to a Skia image, and then convert that to a Compose ImageBitmap. This is preferred over rolling our own UIImage.toSkiaImage logic since Jetbrains will (presumably) keep that up to date as Compose Multiplatform continues to mature, given us access to more color spaces.
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.
What is this PR?
This removes the homegrown
UIImage.toSkiaImage().toImageBitmap()logic and replaces it with some standard library functions instead.Also removes the default generated
Platform.ktfiles since those are unused here.Why is this happening?
Selfishly, because I encountered a very difficult to sus out
EXC_BAD_ACCESSerror with the existing logic where my app would crash upon trying to load any contacts, and this fixes it while also making everyone's life a little easier by letting Jetbrains and their super smarty-pants engineers handle the weird image conversion logic. Any day where I can remove code dealing with pointers is a day I can mark as a success, for sure.Everyone wins!