-
-
Notifications
You must be signed in to change notification settings - Fork 18
Native support for resizing images while decoding #69
Comments
@sahilbajaj do you know any API that is providing this functionality already, as a source of inspiration? |
yeah.. on Android there is a very widely used something called BitmapFactory.Options and we can pass BitmapFactory.decode(path, Options) |
Oh, nice. Thanks for sharing. I think we could do something similar and allow to provide a width and height to the decoding options. We have formats provided by korim/user and native decoders. I guess we should consider a mechanism that support for example emitting rows and executing code for each emitted row in a generic way to do the scaling (but still in some cases like jpeg progressive mode, support the decoder to do it another way), and then also support providing those parameters for example for Android or other native providers supporting scaling at the native decoder layer. What is your usecase here? Making thumbnails for potentially very large images using as few memory as possible? |
We are building a video editor using korlibs. (primarily korge) 😜 |
Yeah.. That's the thing. We'll have to implement our custom down sampler as well besides using the native platform ones. |
iOS does have support for downsampling in CoreGraphics framework. There is an api called CGImageSourceCreateThumbnailAtIndex which handles the downsampling based on the downsample options that we pass as a parameter. Here is good WWDC video about the usage of this API(starting at 11 minutes) : https://developer.apple.com/videos/play/wwdc2018/219/ |
Currently the images are decoded at their original resolution.
Even though BitmapExt provides bitmap resizing capabilities, sometimes it doesn't make sense to decode images at original resolution first especially when they're large.
The text was updated successfully, but these errors were encountered: