Crop ๐
Usageโ
import { openCropper } from '@baronha/react-native-multiple-image-picker'
const cropConfig: CropConfig = {
// ...
}
const open = async () => {
try {
const response = await openCropper('file://path/to/image.jpg', cropConfig)
setImages(response)
} catch (e) {
// catch error for multiple image picker
}
}
CropConfigโ
circleโ
Enable circular crop mask.
- Type: boolean
- Default:
false - Required: No
- Platform: iOS, Android
ratioโ
Aspect ratios for cropping. Android: Maximum: 4 items
- Type:
array - Default:
undefined - Required: No
- Platform: iOS, Android
- Properties:
title: string - Display title for the ratio (e.g., "Square", "16:9")width: number - Width value for the aspect ratioheight: number - Height value for the aspect ratio
defaultRatioโ
Default ratio to be selected when opening the crop interface.
- Type:
object - Default:
undefined - Required: No
- Platform: iOS, Android
- Properties:
title: string - Display title for the ratio (e.g., "Square", "16:9")width: number - Width value for the aspect ratioheight: number - Height value for the aspect ratio
freeStyleโ
Enable free style cropping.
- Type:
boolean - Default:
false - Required: No
- Platform: iOS, Android
languageโ
- Type:
string - Default:
false - Required: No
- Platform: iOS
See Language
Resultโ
pathโ
- Type:
string
widthโ
- Type:
number
heightโ
- Type:
number