react-native-transformable-image icon indicating copy to clipboard operation
react-native-transformable-image copied to clipboard

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

Open VlCTORlOUS opened this issue 8 years ago • 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

VlCTORlOUS avatar Jan 30 '17 10:01 VlCTORlOUS

+1 get same issue too

EDIT: Add pixels props solve this error

pewh avatar Mar 01 '17 08:03 pewh

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

HananeAlSamrout avatar Mar 27 '17 06:03 HananeAlSamrout

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()...

andrey-skl avatar Apr 22 '17 19:04 andrey-skl

@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.

rgoldiez avatar Apr 22 '17 19:04 rgoldiez

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 https://github.com/facebook/react-native/issues/13630

andrey-skl avatar Apr 22 '17 20:04 andrey-skl

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

tuckg avatar Jul 21 '17 01:07 tuckg

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

ducpt2 avatar Nov 24 '17 10:11 ducpt2

This is actually triggered by a bug in React Native quite old https://github.com/facebook/react-native/issues/10002

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

maraujop avatar Apr 24 '18 11:04 maraujop