alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 435 forks source link

iOS not loading image -> <error>: CGAffineTransformInvert: singular matrix. #87

Open Axort opened 6 years ago

Axort commented 6 years ago

Hi!

Sometimes In iOS the images doesn't load. In Android works perfectly.

I'm using: react-native: 0.45.1 react-native-photo-view@1.4.0

This is my code:

<PhotoView 
                source={{uri: this.props.photo.url}} 
                minimumZoomScale={1}
                maximumZoomScale={3}
                androidScaleType='fitCenter'
                onLoad={() => this.setState({ imageLoading: false })}
                onLoadStart={() => console.log('download started')}
                onLoadEnd={() => console.log('download ended')}
                style={styles.imageFullScreen} />

I noticed that when the images don't load, the console show this error:

: CGAffineTransformInvert: singular matrix.

Also when the image loads successfully, the 'download started' console log appears. When the image fail to load, it only shows the 'download ended' console log.

Am i doing something wrong? or is there a property am I missing?

Thanks in advance.

samanthacampisi commented 6 years ago

I can confirm this

zackify commented 6 years ago

Not seeing the error, but every few times you view an image it will return a black area after onLoadEnd

srameshr commented 6 years ago

Yes! Same here. I can confirm this. I dont see any logs in the simulator logger when the image fails to load. Just a blank screen. My images are being served over https. Did anyone find a solution for this?

igMartin commented 6 years ago

Same issue here guys. I discover that if I change the image, it would load perfectly the first time. If I navigate, changing route and go back (or either refresh the app), it will show a black area. When tapping in the black area where the image is supossed to be it yields: Error calling RCTEventEmitter.receiveEvent folly::toJson: JSON object value was a NaN or INF If I change the image for a new one, it will work again (until I change route or reload, then the black box again.) Couldn't find a solution yet.

srameshr commented 6 years ago

@igMartin Same here. Both on 1.3.x and 1.4.x

fschai89 commented 6 years ago

I also face same problem, the image sometimes load sometimes not load in IOS.