https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

Elizabeth Mezias

05/11/2020, 8:58 PM
Is anybody using an efficient and common file format for image assets across platforms, especially on Android and iOS? Webp is possible. There are several iOS libraries and SDWebImage looks good. Seems like using the same assets, even just the same process for converting assets would offer efficiency for a cross platform development team. I got a (IPA max) file size problem to fix with efficient formats and I want to solve it for the least number of design team file conversions and the fastest rendering.
Also! Any suggestions for conversion tools that output efficient formats (Webp, HEIC, HEIF, etc) would be great.
k

krtko

05/12/2020, 1:56 AM
We use WEBP on iOS. It works great. Not much to it lol
🙏 1
e

Elizabeth Mezias

05/12/2020, 3:25 AM
Do you use SDWebImage or some other library to decode it?
k

krtko

05/12/2020, 5:27 AM
We use SDWebImage to decode it. I have had zero issues and it's cut the size of our images by a huge amount. It's really reduced everyone's bandwidth costs.
The only embedded webp we have in the app itself is an animated one
There's nothing holding you back except all the benefits of using iOS' image asset library. It might not be worth it except for large large images
m

magnumrocha

05/12/2020, 10:23 AM
@Elizabeth Mezias what is your goal? just load and show images on your App's UI or process the images on background for some business logic?
e

Elizabeth Mezias

05/12/2020, 12:56 PM
The images are static and it is mostly load and show them in the app. There are some animations. The goal is to reduce the overall size of the app by migrating to more modern, mobile file formats
m

magnumrocha

05/12/2020, 1:05 PM
so, in my understand, the goal of kotlin multiplatform (KMP) is
share the common logic between the platforms
, load/cache/show images on App's UI can be successfully achieved using the current libraries or frameworks, like
glide
or
coil
for Android, and the many libraries existent for swift in iOS (like
SDWebImage
) that do their job in the more effective way. So, in my point of view, load the image on kotlin side for native targets, just to load the image on UI, is not a good use of the KMP technology... unless, you want to do some specific job (business logic) with this image.
e

Elizabeth Mezias

05/12/2020, 1:09 PM
Thanks. You are right. That's good feedback. My goal is to evaluate some libraries that can improve the cross platform app building process and this is the best way to poll people about using WebP across platforms. I'm new to this Slack team. Seems like a reasonable question.
s

Sam

05/12/2020, 1:30 PM
iOS has an on demand resource feature that you should look into. Basically, a separate resource bundle is uploaded to Apple and your app pulls down the ones it needs asynchronously at runtime. It acts like a cache, keeping around the ones most used and removing the ones least used on the device. Apple TV apps have to use this a lot.
e

Elizabeth Mezias

05/12/2020, 9:18 PM
Thanks, yes, that kind of dynamic loading is interesting. My team actually did code with Cloudinary using on-demand images. Network latency or an unavailable network (especially when app download and launch get separated) is a deal breaker for us. There are Apple Store IPA optimizations that help us. However, the test team gets a build with all of the (jpg/png/pdf) resources and all sizes in it and that it how you can hit the file size limit.
49 Views