question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Image Handling Improvements

See original GitHub issue

Issue details / Repro steps / Use case background: In this library, handling the memory used by images is not managed at all, which leads to OOMs on several devices(e.g. #551 )I would like to discuss, how we can improve the image handling on our library. I have a few ideas:

  1. Scaling drawables(as Bitmaps) before setting them to their respective imageviews.***

  2. For even better support you can take a look at these links:

a) https://developer.android.com/topic/performance/graphics/manage-memory

b) https://developer.android.com/topic/performance/graphics/cache-bitmap

c) https://blog.booking.com/android-reuse-bitmaps.html

OR

  1. We provide separate modules that use Image loading libraries like Glide, Picasso for loading images as optional dependencies along with our library (probably the easiest).

OR

  1. We could provide a way for the user to get imageviews so that an image loading library can be used(probably not recommended).

***: Highly recommended regardless of approach taken.

Tell me your thoughts on which approach is better and if you know of any other alternative.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
paolorotolocommented, Jun 5, 2019

Having some layer that takes care of image loading is ok for me. I’m not sure if we want to add anyway a method to get the ImageView from the default intro: it’s true that some devs could use other libaries or internal solutions to handle image loading but it’s also true they can simply write a slide fragment and handle resources themself.

1reaction
cortinicocommented, Jun 5, 2019

Hey @AnuthaDev I’ll probably go for either 3 or 4.

Can you please justify why you would go for option 1 rather than the others?

My point of view is: 3 - I would generally like the idea of having some sort of abstraction layer that takes care of loading images. Then we can publish an appintro-image-glide or app-image-picasso to provide binding with the common libraries.

4 - That’s the quick and dirty solution. Just expose an ImageView to the user, he will take care of loading the content inside. It will anyway break the encapsulation principle and is generally not the best solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improved Image Handling - Blog - Discourse
We feel that Discourse now has some of the best default image handling of any community discussion software out there.
Read more >
10 Image Optimization Tips for Your Ecommerce Website
Improved search performance. Optimized images help both readers and search engines understand your website better and get your content seen ...
Read more >
Image Processing - an overview | ScienceDirect Topics
The discipline of digital image processing is a vast one, encompassing digital signal processing techniques as well as techniques that are specific to...
Read more >
What is Image Pre-processing Tool and how its work?
The aim of pre-processing is an improvement of the image data that suppresses undesired distortions or enhances some ... Let's discuss each type...
Read more >
Brief review of image denoising techniques
In addition, we discuss the characteristics of these techniques. ... With the presence of noise, possible subsequent image processing tasks, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found