Skip to content

Extremely pixelated image when zooming in with ScrollView #20480

@CharlieOrlando

Description

@CharlieOrlando

Environment

Environment:
OS: macOS High Sierra 10.13.5
Node: 7.7.1
Yarn: 0.27.5
npm: 4.3.0
Watchman: 4.7.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Description

I have a large image (2338x2940) that is within a ScrollView. Resizing the image down, with contain, to the device size makes it fit, but when zooming with the ScrollView, the image is incredibly blurry. However, if I first render the image with full dimensions, using resizeMode="contain", then switch the resizeMode to 'cover' AND change the dimensions to the device size, everything works perfectly. The image fits and is perfect quality on zoom.

I'm not sure why this is happening, but it makes for an incredibly poor user experience. I'm currently using a hacky workaround with opacity to hide the image until it's loaded, but I'd really like to know if there's a better solution.

Here's two example images to demonstrate the issue...

simulator screen shot - iphone 7 - 2018-07-31 at 19 12 38
simulator screen shot - iphone 7 - 2018-07-31 at 19 12 26

Reproducible Demo

<Image source={{uri: this.props.imageSource}} resizeMode={this.state.isImageLoaded ? 'cover' : 'contain'} style={[styles.image, {width: this.state.imageWidth, height: this.state.imageHeight, opacity: this.state.isImageLoaded ? 1 : 0}]} onLoad={() => this.handleImageLoad()} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions