-
Notifications
You must be signed in to change notification settings - Fork 105
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
Provide a way to load an Image directly from NSData #887
Comments
Hi @StefanOltmann ! please have a look at this PR https://github.com/JetBrains/skiko/pull/873/files |
Thank you for a hint. I missed the change somehow. Sorry about that. Can you explain „ // skia makes an internal copy of the nsData bytes“? |
Okay, so this PR fixes that I don't require to have the same bytes three times in memory as I have when I load it as NSData (first), convert it to Kotlin ByteArray (second) and give it to SKIA which makes a third copy. Two copies in memory is better than three. Even better would be just one copy. :) |
Can you give me a link to that? Then we can close this issue. |
Right now we need to convert Apple
NSData
to a KotlinByteArray
, before we can load anImage
from it. This memory copy doubles the memory required and turns out to be a problem for photo manager apps like Ashampoo Photos that do this for thousands of photos.I need a way in Compose for iOS for directly decode an image from the raw bytes of NSData. This should be memory efficient and not copy to a
ByteArray
internally.The text was updated successfully, but these errors were encountered: