Skip to content

Images are decoded without resizing: #335

@sunshinelwj

Description

@sunshinelwj

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

I noticed that in the following code of Document Viewer, image resizing is correctly applied:
org.ebookdroid.ui.opds.adapters.LoadThumbnailTask.java loadBookThumbnail() (line number:80)
https://github.com/SufficientlySecure/document-viewer/blob/master/document-viewer/src/main/java/org/ebookdroid/ui/opds/adapters/LoadThumbnailTask.java#L80

However, in the code below, images are decoded directly without resizing:
org.ebookdroid.common.cache.ThumbnailFile.java load() (line number: 96)
https://github.com/SufficientlySecure/document-viewer/blob/master/document-viewer/src/main/java/org/ebookdroid/common/cache/ThumbnailFile.java#L96

I am curious about the latter case. Why this method does not resize images? For the images to be displayed, in many cases, they are larger than required.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions