iyegoroff / react-native-image-filter-kit

Various image filters for iOS & Android
MIT License
320 stars 43 forks source link

I get ImageFilterKit: recieved memory warning and then app crashes #44

Closed singhvivek2503 closed 4 years ago

singhvivek2503 commented 4 years ago

I am using react-native-image-filter-kit to provide image filters.

On IOS It works fine for photo upload from library but when I click picture from camera it gives Memory errors. Works on simulator but crashes on real device iPhone SE

Below is the repo link. MyApp

Please follow these steps when you run the app on real device.

  1. Run the app on real device
  2. App loads
  3. Click "New Post"
  4. Click "Photo" tab in the bottom
  5. Click a picture using Phone Camera
  6. Wait for the clicked picture to load
  7. After loading showing the clicked picture the app crashes in few seconds

Logs attached below:

2020-06-05 23:09:02.704316+0530 Client[10593:1944431] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"" 2020-06-05 23:09:09.689875+0530 Client[10593:1944277] ImageFilterKit: max cache size 737.871 MB 2020-06-05 23:09:09.759988+0530 Client[10593:1944598] Metal GPU Frame Capture Enabled 2020-06-05 23:09:09.760419+0530 Client[10593:1944598] Metal API Validation Enabled 2020-06-05 23:09:11.295933+0530 Client[10593:1944604] [SOServiceConnection] <SOServiceConnection: 0x281adedc0>: XPC connection interrupted 2020-06-05 23:09:11.307326+0530 Client[10593:1944614] [ServicesDaemonManager] interruptionHandler is called. -[FontServicesDaemonManager connection]_block_invoke 2020-06-05 23:09:12.606644+0530 Client[10593:1944277] ImageFilterKit: recieved memory warning !!! 2020-06-05 23:09:12.606745+0530 Client[10593:1944277] ImageFilterKit: clear cache Message from debugger: Terminated due to memory issue

iyegoroff commented 4 years ago

Please provide a reproducible example.

singhvivek2503 commented 4 years ago

@iyegoroff Added a repo to the ticket with reproducible issue.

iyegoroff commented 4 years ago

@singhvivek2503 the example you provided is pretty big. I'm not going to check it. Consider making a minimal repro.

leurs247 commented 3 years ago

I'm facing the same issue. Any solutions for this? Loading a local URL forces the app to crash on a iOS device.

cmora commented 3 years ago

@samleurs247 @singhvivek2503 If you need this yet. I just solved my issue forcing the image size of the photo for IOS. This if you are using https://github.com/react-native-image-picker/react-native-image-picker

const options = {
      mediaType: 'photo',
      saveToPhotos: false,
    };

    if (isIos) {
      options.maxWidth = 2000;
      options.maxHeight = 2000;
    }

    launchCamera(options, response => {