Skip to content

Commit e42bd50

Browse files
committed
add option to set the max bitmap generated size. Default to 0
1 parent bbeef97 commit e42bd50

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ The result file is saved in `NSTemporaryDirectory` on iOS and application Cache
9999
| `lockAspectRatio` | set to true if you want to lock the aspect ratio of crop bounds with a fixed value (locked by default) | bool |
100100
| `hideBottomControls` | set to true to hide the bottom controls (shown by default) | bool |
101101
| `initAspectRatio` | desired aspect ratio is applied (from the list of given aspect ratio presets) when starting the cropper | CropAspectRatioPreset |
102+
| `maxBitmapSize` | the maximum size of the Bitmap object generated after cropping | int |
102103

103104

104105
### iOS

android/src/main/java/vn/hunghd/flutter/plugins/imagecropper/ImageCropperDelegate.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void startCrop(MethodCall call, MethodChannel.Result result) {
4141
Integer compressQuality = call.argument("compress_quality");
4242
ArrayList<String> aspectRatioPresets = call.argument("aspect_ratio_presets");
4343
String initAspectRatio = call.argument("android.init_aspect_ratio");
44+
Integer maxBitmapSize = call.argument("android.max_bitmap_size");
4445

4546
pendingResult = result;
4647

@@ -52,6 +53,7 @@ public void startCrop(MethodCall call, MethodChannel.Result result) {
5253
UCrop.Options options = new UCrop.Options();
5354
options.setCompressionFormat("png".equals(compressFormat) ? Bitmap.CompressFormat.PNG : Bitmap.CompressFormat.JPEG);
5455
options.setCompressionQuality(compressQuality != null ? compressQuality : 90);
56+
options.setMaxBitmapSize(maxBitmapSize != null ? maxBitmapSize : 0);
5557

5658
// UI customization settings
5759
if ("circle".equals(cropStyle)) {

0 commit comments

Comments
 (0)