Skip to content

Simplify iOS Image Loading#6

Open
wardellbagby wants to merge 2 commits into
dev-bilal-azzam:developfrom
wardellbagby:wardell/simplify-ios-image-loading
Open

Simplify iOS Image Loading#6
wardellbagby wants to merge 2 commits into
dev-bilal-azzam:developfrom
wardellbagby:wardell/simplify-ios-image-loading

Conversation

@wardellbagby

Copy link
Copy Markdown

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.kt files since those are unused here.

Why is this happening?

Selfishly, because I encountered a very difficult to sus out EXC_BAD_ACCESS error 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!

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant