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

Pass actual loaded image size to load (iOS). #15116

Closed
wants to merge 1 commit into from
Closed

Pass actual loaded image size to load (iOS). #15116

wants to merge 1 commit into from

Commits on Jul 20, 2017

  1. Pass actual loaded image size to load (iOS).

    Motivation: The JavaScript image component's onLoad callback optionally
    accepts dimensions width and height, allowing the parent of the image to
    obtain the native size (without an extra bridge call). It was found that
    the dimensions passed into this callback on iOS are frequently (0,0),
    not the true native dimensions. This change ensures that the image's
    dimensions are passed to the callback. (Examination of the initializer
    for RCTImageSource, + (RCTImageSource *)RCTImageSource:(id)json,
    indicates that not all code paths produce a size other than CGSizeZero.)
    
    Test plan: To verify this fix, load an image (in my case, from the
    network) with the onLoad callback simply logging the received
    dimensions. Obeserve that without this fix, the dimensions are (0,0),
    whereas this change passes the dimensions
    Shir Levkowitz authored and lshir committed Jul 20, 2017
    Configuration menu
    Copy the full SHA
    43b3043 View commit details
    Browse the repository at this point in the history