meliorence / react-native-image-gallery

Pure JavaScript image gallery component for iOS and Android with high-performance and native feeling in mind
715 stars 298 forks source link

Error decoding image data <NSData 0x6000030192f0; 82644 bytes> #129

Open peckpeck20 opened 5 years ago

peckpeck20 commented 5 years ago

Using the image gallery sometimes some images fail to load and I get a blank screen. Its worth noting that this happens on iOS devices.

Looking more into this, I created a custom img component and logged the error and I get this => Error decoding image data <NSData 0x6000030192f0; 82644 bytes>

this is how my component looks at the moment :

private getCustomImageComponent = (imageProps: any) => { const { width, height } = commonConstants.viewport; return ( <Image {...imageProps} onError={({ nativeEvent: { error } }) => { console.log(error); }} style={{ width: width, height: height }} resizeMode="contain" /> ); };

` <Gallery style={[styles.gallery]} images={[{ source: this.props.primaryImage }]} imageComponent={this.getCustomImageComponent} />

    </SafeAreaView>`

Version: "react-native-image-gallery": "^2.1.5", "react": "^16.6.3", "react-native": "^0.58.5",