Тёмный

How to Implement Image Compression On Android 

Philipp Lackner
Подписаться 186 тыс.
Просмотров 4,7 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 18   
@leanngugi
@leanngugi День назад
If I wasn't poor I'd buy your courses. Thanks for the things you give us for free.
@lg.studio
@lg.studio День назад
Earlier this year did a similar thing in my the I was working on, but my solution was to also down-scale it to a limited max 1600px (longer edge), as the project allowed to use smaller resolution images for the given purpose. As many new phones make too high resolution images for many purposes, down-scaling worked much better for me.
@Alexmez
@Alexmez День назад
Best android mentor and teacher, 💯💯💯
@clementjoymasinamela4244
@clementjoymasinamela4244 День назад
Very useful tutorial, thanks. Can you please do a tutorial on video compression.
@tarsilacostalonga
@tarsilacostalonga День назад
Great one! Thanks ❤
@pawandeepsingh6365
@pawandeepsingh6365 27 минут назад
Hey Philipp, Could you please make a video how to navigate back from a page to previous page, by swiping left to right, current page shifts left to right revealing previous page below? Please
@esekaemmanuel7295
@esekaemmanuel7295 День назад
Thank you ❤
@berlinisaiah6892
@berlinisaiah6892 День назад
Thank you very much
@anudeepananth
@anudeepananth День назад
Can you please plz post more Compose Multiplatform videos
@natanell777
@natanell777 День назад
Why are you using remember in MainActivity? It’s not like a counter where the value can change. How can recomposition happen here?
@John-qt6qk
@John-qt6qk День назад
Thanks
@shubhamkokatnur6994
@shubhamkokatnur6994 День назад
is this possible in java also?
@ОлексійКондрашов-ю3и
Compressing in loop leads to OutOfMemory and not the best solution obviously. Trying to compress images with more than 20-30 mb leads to app crash
@PhilippLackner
@PhilippLackner День назад
The app compressed 20MB images for me without any issues. Since the loop uses a new stream with each iteration, the previous one can be freed up. Therefore, there are allocations for the input byte array, the bitmap and the currently compressed byte array which even for a 20MB image is 50-60MB in memory allocations and is not a lot given what modern devices have as RAM.
@ОлексійКондрашов-ю3и
​@@PhilippLackner ​ 20 mb is a compressed image, but when processing it converts to uncompressed bitmap that could take more than 1gb of RAM depends on resolution. Images in Android are displayed with ARGB888 with 4 bytes for 1 px. if we have image resolution 20000x20000 ( I really have one, it is space photo) Bitmap from this image has 1.5 GB size. I checked just know - if I open default image in MS Paint - it take 100-140 mb of RAM (In Task Manager) But if i open the large one - it takes 3.6 GB of RAM. The same happens when you just loading and compressing image in loop but several times! I understand that this case with 20000x20000 image is super rare, but if you develop serious apps with many active users your app will crash if try to load this image. The only workaround is to use BitmapOptions.inSampleSize and already load much more smaller image. For example Telegram compresses all images to fixed 1280px by the larger side. And Telegram doesnt crash when trying to load this image. But if use "loop" approach - it will crash 100%
@topwings2836
@topwings2836 Час назад
Course price is 9900€ then as per india Rs.832369 ruphee,Pls someone calrify me
@ka61er
@ka61er День назад
😂
Далее
15 POWERFUL Python Libraries You Should Be Using
22:31
This Folder Structure Makes Me 100% More Productive
24:36
Is THIS the End of the Google Play Monopoly?
6:36
Просмотров 24 тыс.
How is this Website so fast!?
13:39
Просмотров 474 тыс.
I Remade YouTube From Scratch Using Just Bash
17:51
Просмотров 60 тыс.
Inspired by MKBHD | Built with Flutter - Panels App
24:24