expo: ImagePicker quality option not working and storage alway increase 4Mb -> 7Mb (version 31.0.0, 30.0.0)

Hi there,

In version 31, I tried to use ImagePicker (Android) to let user capture the image. As I read the document, it have support an option called quality. This option value is from 0 to 1. I understand that 1 is maximum quality. But when I set the value from 0 to 1, I always received an image that had size from 4mb to 7mb. The size and quality of image did not reduce.

Is there anyone have the issue like me? Or I did it incorrectly?

BTW, I found another issue. When the user use camera to capture image (ImagePicker) the storage(app, cache) of the app alway increase 4Mb -> 7Mb

I have tried FileSystem to delete the file of the ImagePicker result. I can delete the file but the size of the storage alway increase

Snack url: https://snack.expo.io/ByI5m3mi7

Storage before use ImagePicker Storage before use ImagePicker

Storage after use ImagePicker and capture an image Storage after use ImagePicker and capture an image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I fixed the issue with the quality attribute. I will try to remove unnecessary caching later.

@sjchmiela Thanks for your help. I have resolved the issue with the flow bellow:

  1. Add NDK PATH:
export ANDROID_SDK=/Users/<user>/Library/Android/sdk
export ANDROID_NDK=/Users/<user>/Library/Android/sdk/ndk-bundle
export PATH="$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK"
  1. Run yarn in tools, tools-public and expokit-npm-package
  2. Run gulp update-exponent-view --abi 31.0.0 in tools
  3. Run npm pack in expokit-npm-package

Hey, sorry, I got caught up in other features and fixes, a fixing pull request is almost ready to be merged, it will definitely land in SDK32. 🙂

a screenshot from real user @bbarthec This is image from real user send to me ( 1 day use my app :( )