QuantumBadger / QuantumBadger/RedReader
Suggestion for improving image loading
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 527
- Avg merge
- 20d 10h
- Merged PRs (30d)
- 3
Description
Dear developers,
I am a user of RedReader, and thank you for the wonderful work.
When I click an item and browse it's image, for some large images, the downloading process will take a long time.
For example, the situation below can consume more than 10 seconds:

In many cases images are larger than required. Android documentation suggests us to resize the image according to the size of the UI component that displays it. By properly resizing image before downloading and decoding, we can save memory resource and make app run more smoothly, which can provide users with a better experience.
https://developer.android.com/topic/performance/graphics/load-bitmap.html#read-bitmap
I noticed that in the following code, image resizing is correctly applied:
org.quantumbadger.redreader.views.imageview.ImageTileSourceBitmapRegionDecoder.java getTile()
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/views/imageview/ImageTileSourceBitmapRegionDecoder.java#L75
However, in the code below, images are decoded directly without resizing:
org.quantumbadger.redreader.activities.ImgurUploadActivity.java (line number 213)
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/activities/ImgurUploadActivity.java#L213
org.quantumbadger.redreader.adapters.AlbumAdapter.java (line number 157)
https://github.com/QuantumBadger/RedReader/blob/master/src/main/java/org/quantumbadger/redreader/adapters/AlbumAdapter.java#L157
I am not familiar with the source code of RedReader, so I am not sure whether the code listed above corresponds to the situation I described. However, whether it is or not, I think they all need to be optimized.
Do you think image resizing will improve RedReader' performance? If yes, perhaps resizing image before downloading can make RedReader more smooth in user interaction.
Looking forward to your response.
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with getTile() in org.quantumbadger.redreader.views.imageview.ImageTileSourceBitmapRegionDecoder.java, then inspect the direct decoding at lines 213 and 157 of ImgurUploadActivity.java and AlbumAdapter.java. Determine whether those paths match the reported large-image delay; done means the relevant images are resized before downloading and decoding, with the loading behavior verified against the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100