Skip to content
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

Images are decoded without checking image size when loaded from a Filemanager in a Nomedia-Folder #197

Open
sunshinelwj opened this issue Nov 28, 2021 · 0 comments

Comments

@sunshinelwj
Copy link

When loading an image, Google suggests us to resize the image before decoding them, so as to save memory resource.
https://developer.android.com/topic/performance/graphics/load-bitmap.html

However, in the code below, images are decoded directly without checking image size:
de.k3b.android.androFotoFinder.gallery.cursor.GalleryCursorAdapterFromArray.java getView() (line number: 120)
https://github.com/k3b/APhotoManager/blob/FDroid/app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorAdapterFromArray.java#L120

Are these images all of small sizes? Do you think they will affect APhotoManager's performance?

In addition, getView() is a callback that is frequently invoked in the UI thread. since image decoding is of high time consumption, we can perform these operations in worker threads (e.g., via AsyncTask).

@k3b k3b changed the title Images are decoded without checking image size Images are decoded without checking image size when loaded from a Filemanager in a Nomedia-Folder Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant