Skip to content

Android - Image.getSize is unnecessarily decoding image #14357

@orenklein

Description

@orenklein

Image.getSize is unnecessarily decoding image which is causing an high memory bump (which will be garbage collected in the future)

Reproduce (the specific url is used to show a big size image example) :

 Image.getSize("https://www.nasa.gov/sites/default/files/thumbnails/image/oct_1_2015_flare.jpg",
      (width,height)=>{
            //code
      }
)

The above example is causing memory bump of approximately 50MB.
In think that using encoded image instead of decoded image is the right approach.

I will add a pull request - change the implementation to use encoded image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions