You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -39,33 +39,38 @@ Crop the image specified by the URI param. If URI points to a remote image, it w
39
39
If the cropping process is successful, the resultant cropped image will be stored in the cache path, and the URI returned in the promise will point to the image in the cache path. Remember to delete the cropped image from the cache path when you are done with it.
|`offset`| Yes | The top-left corner of the cropped image, specified in the original image's coordinate space |
51
-
|`size`| Yes | Size (dimensions) of the cropped image |
52
-
|`displaySize`| No | Size to which you want to scale the cropped image |
53
-
|`resizeMode`| No | Resizing mode to use when scaling the image (iOS only, android resize mode is always 'cover') **Default value**: 'contain' |
54
-
|`quality`| No | The quality of the resulting image, expressed as a value from `0.0` to `1.0`. <br/>The value `0.0` represents the maximum compression (or lowest quality) while the value `1.0` represents the least compression (or best quality).<br/>iOS supports only `JPEG` format, while Android supports both `JPEG`, `WEBP` and `PNG` formats.<br/>**Default value**: (iOS: `1`), (Android: `0.9`) |
|`offset`| Yes | The top-left corner of the cropped image, specified in the original image's coordinate space |
53
+
|`size`| Yes | Size (dimensions) of the cropped image |
54
+
|`displaySize`| No | Size to which you want to scale the cropped image |
55
+
|`resizeMode`| No | Resizing mode to use when scaling the image (iOS only, Android resize mode is always 'cover', Web - no support) **Default value**: 'contain' |
56
+
|`quality`| No | The quality of the resulting image, expressed as a value from `0.0` to `1.0`. <br/>The value `0.0` represents the maximum compression (or lowest quality) while the value `1.0` represents the least compression (or best quality).<br/>iOS supports only `JPEG` format, while Android/Web supports both `JPEG`, `WEBP` and `PNG` formats.<br/>**Default value**: (iOS: `1`), (Android: `0.9`) |
57
+
|`format`| No |**(WEB ONLY)** The format of the resulting image, possible values are `jpeg`, `png`, `webp`, **Default value**: `jpeg`|
55
58
56
59
```ts
57
60
cropData: ImageCropData= {
58
61
offset: {x: number, y: number},
59
62
size: {width: number, height: number},
60
63
displaySize: {width: number, height: number},
61
64
resizeMode: 'contain'|'cover'|'stretch',
62
-
quality: number// 0...1
65
+
quality: number, // 0...1
66
+
format: 'jpeg'|'png'|'webp'// web only
63
67
};
64
68
```
65
69
66
70
For more advanced usage check our [example app](/example/src/App.tsx).
0 commit comments