Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ The result file is saved in `NSTemporaryDirectory` on iOS and application Cache
| `lockAspectRatio` | set to true if you want to lock the aspect ratio of crop bounds with a fixed value (locked by default) | bool |
| `hideBottomControls` | set to true to hide the bottom controls (shown by default) | bool |
| `initAspectRatio` | desired aspect ratio is applied (from the list of given aspect ratio presets) when starting the cropper | CropAspectRatioPreset |
| `maxBitmapSize` | the maximum size of the Bitmap object generated after cropping | int |


### iOS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void startCrop(MethodCall call, MethodChannel.Result result) {
Integer compressQuality = call.argument("compress_quality");
ArrayList<String> aspectRatioPresets = call.argument("aspect_ratio_presets");
String initAspectRatio = call.argument("android.init_aspect_ratio");
Integer maxBitmapSize = call.argument("android.max_bitmap_size");

pendingResult = result;

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

// UI customization settings
if ("circle".equals(cropStyle)) {
Expand Down