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