Skip to content

Commit f121d94

Browse files
committed
chore: Update README
1 parent 3d8a9ec commit f121d94

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ ImageEditor.cropImage(uri, cropData).then((url) => {
5454
| `displaySize` | No | Size to which you want to scale the cropped image |
5555
| `resizeMode` | No | Resizing mode to use when scaling the image (iOS only, Android resize mode is always 'cover', Web - no support) **Default value**: 'contain' |
5656
| `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` |
57+
| `format` | No | The format of the resulting image, possible values are `jpeg`, `png`, `webp`. <br/> **Default value**: based on the provided image; if value determination is not possible, `jpeg` will be used as a fallback. <br/> `webp` isn't suported by iOS. |
5858

5959
```ts
6060
cropData: ImageCropData = {
61-
offset: {x: number, y: number},
62-
size: {width: number, height: number},
63-
displaySize: {width: number, height: number},
61+
offset: { x: number, y: number },
62+
size: { width: number, height: number },
63+
displaySize: { width: number, height: number },
6464
resizeMode: 'contain' | 'cover' | 'stretch',
6565
quality: number, // 0...1
66-
format: 'jpeg' | 'png' | 'webp' // web only
66+
format: 'jpeg' | 'png' | 'webp',
6767
};
6868
```
6969

android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModuleImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ class ImageEditorModuleImpl(private val reactContext: ReactApplicationContext) {
440440
else -> outOptions.outMimeType
441441
}
442442
if (mimeType.isNullOrEmpty()) {
443-
throw IOException("Could not determine MIME type")
443+
return "image/jpeg"
444444
}
445445
return mimeType
446446
}

0 commit comments

Comments
 (0)