ldn0x7dc/react-native-transformable-image

Android crash - getImageSize...error={"framesToPop":1,"code":"E_GET_SIZE_FAILURE"}

Opened this issue · 8 comments

When using this module on Android my App crashes and I get the following error:

getImageSize...error={"framesToPop":1,"code":"E_GET_SIZE_FAILURE"}, source={"uri":"https://s3.eu-central-1.amazonaws.com/partyboote-staging/media/58598a1de2c26.jpg"}

On iOS it workes perfectly fine!
Here is how I try to use it:

...
import TransformableImage from 'react-native-transformable-image';
...
const screenHeight = Dimensions.get('window').height;
const screenWidth = Dimensions.get('window').width;
...

render() {
   ...
   return (
      ...
      <View style={{flex: 1}}>
          <TransformableImage
              resizeMode={'contain'}
              source={{uri: mediaUrl}}
              style={{height: screenHeight, width: screenWidth}}/>
      </View>
      ...
   )
}

Did I do something wrong?
I know that I used this module in an older project the same way I am trying to do here, and it worked.

Thanks in advance :)

Here is a screenshot:

screenshot-2017-01-30_11 54 11 661

pewh commented

+1 get same issue too

EDIT:
Add pixels props solve this error

my problem was solved by transforming images from .jpg to .png

I get this issue because my server returns image only if auth cookie is set. But there is no way to pass cookie to react native's Image.getSize()...

@huston007 - I've faced the same issue as you described. My work around was to fetch the image with an API call using a token and storing it locally. Then I used getSize and render the local copy.

In my case it worked before and works on iOS. But looks like cookies passing to image load requests is broken on android now. I created an issue facebook/react-native#13630

tuckg commented

I have the same problem when I try to show Image from CameraRoll.getPhotos, Anyone know how to solve it?

I set pixel like @pewh did, but i choose a big number like {{ width: 10000, height: 10000 }}, don't know what is right. :)

This is actually triggered by a bug in React Native quite old
facebook/react-native#10002

When you pass pixels property you are preventing react-native-transformable-image to call getSize which is obviously buggy.