Skip to content

ImageLoader.getSize can lead to an infinite interval loop #2749

Open
@lkinasiewicz

Description

@lkinasiewicz

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

getSize implementation is more complicated than should be. There are intervals involved which, in some conditions, can keep running "forever". I have stumbled upon this issue, when I used getSize in some jest tests. The problem occurs, when an image fails to decode and naturalWidth, naturalHeight are 0.

Expected behavior

  1. No potential for infinite timers.
  2. failure callback is called when an image fails to decode.

Steps to reproduce

Unit tests will be provided in a merge request

Test case

Unit tests will be provided in a merge request

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions