Skip to content

Commit 0560834

Browse files
guhungryTrancever
authored andcommitted
docs: Add more info about resizeMode (#25)
`resizeMode` works only in iOS with `contain` as the default value and in Android it's always `cover`.
1 parent 9fce15f commit 0560834

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ Crop the image specified by the URI param. If URI points to a remote image, it w
3232
If the cropping process is successful, the resultant cropped image will be stored in the ImageStore, and the URI returned in the success callback will point to the image in the store. Remember to delete the cropped image from the ImageStore when you are done with it.
3333

3434
### cropData
35-
* `offset` - The top-left corner of the cropped image, specified in the original image's coordinate space
36-
* `size` - Size (dimensions) of the cropped image
37-
* `displaySize` (optional) - Size to which you want to scale the cropped image
38-
* `resizeMode` (optional) - Resizing mode to use when scaling the image
35+
| Property | Required | Description |
36+
|---------------|----------|----------------------------------------------------------------------------------------------------------------------------|
37+
| `offset` | Yes | The top-left corner of the cropped image, specified in the original image's coordinate space |
38+
| `size` | Yes | Size (dimensions) of the cropped image |
39+
| `displaySize` | No | Size to which you want to scale the cropped image |
40+
| `resizeMode` | No | Resizing mode to use when scaling the image (iOS only, android resize mode is always 'cover') **Default value**: 'contain' |
3941

4042
```javascript
4143
cropData = {
4244
offset: {x: number, y: number},
4345
size: {width: number, height: number},
4446
displaySize: {width: number, height: number},
45-
resizeMode: 'contain/cover/stretch',
47+
resizeMode: 'contain' | 'cover' | 'stretch',
4648
};
4749
```
4850

@@ -56,4 +58,4 @@ For more advanced usage check our [example app](/example/src/App.js).
5658
[license-badge]: https://img.shields.io/npm/l/@react-native-community/image-editor.svg?style=flat-square
5759
[license]: https://opensource.org/licenses/MIT
5860
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
59-
[prs-welcome]: http://makeapullrequest.com
61+
[prs-welcome]: http://makeapullrequest.com

0 commit comments

Comments
 (0)