bamlab / react-native-image-resizer

🗻 Resize local images with React Native
MIT License
1.61k stars 347 forks source link

App crash on createResizedImage #341

Closed AlaaElden98 closed 2 years ago

AlaaElden98 commented 2 years ago

I'm using version 3.0.3 : "@bam.tech/react-native-image-resizer": "^3.0.3" After capture an image from camera, I'm passing the required data to createResizedImage, the app is crashing on Android -didn't test on ios- with the following error :

Code :

import ImageResizer from '@bam.tech/react-native-image-resizer';

 const result = await ImageResizer.createResizedImage(
        image.uri,
        image.width / 3.8,
        image.height / 3.8,
        'JPEG',
        100,
      );
      if (result) {
            // do stuff
       }

all passed params are valid. Any idea what causes this ?

sanderdewilde commented 2 years ago

I'm encountering this as well.. Seems like a null pointer exception, file exists though.

The uri is file:///data/user/0/<bundle_id>/cache/rn_image_picker_lib_temp_eb2aee3f-e50a-4b8d-bf28-10a251cbd105.jpg.

I took the photo with launchCamera from react-native-image-picker library (v4.10.0)

icycommond commented 2 years ago

same for me.

ayushmng commented 2 years ago

Same here I'm getting 'createResizedImageWithExceptions' in this issue, has anyone resolved the issue?

taboulot commented 2 years ago

Hey,

Thank you for reporting the issue, I have located theproblem. A new release is coming today.

taboulot commented 2 years ago

@AlaaElden98

Fix published in 3.0.4. I close the issue. Tell me if you still have the problem.