Skip to content

Cookbook

Vishal Narkhede edited this page Jan 14, 2021 · 3 revisions

Image compression

With the release of v1.0, we have introduced an option for allowing image compression before uploading them to CDN. This should help reduce the upload time for heavy images. You can provide a prop on StatusUpdateForm component - compressImageQuality with a value from 0 to 1, where 1 is best quality. On iOS, values larger than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8 will reduce the file size by about half or less compared to a value of 1. Image picker defaults to 0.8 for iOS and 1 for Android

<StatusUpdateForm
   compressImageQuality={0.3}
/>

Internally we are using react-native-image-crop-picker library, for image picker and compression purpose.

[... more stuff will be added soon]

Clone this wiki locally