weta-vn / advance_image_picker

Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotating, cropping, adding sticker/filters.
BSD 3-Clause "New" or "Revised" License
111 stars 51 forks source link

(Question): Circular Image crop #32

Open matthewmizzi opened 3 years ago

matthewmizzi commented 3 years ago

Hi,

I was wondering if it will be possible to have a circular cropping area instead of the normal squarish one?

Thanks in advance

Crop

rydmike commented 3 years ago

Hi @matthewmizzi the crop edit feature used in this packages uses https://pub.dev/packages/image_cropper, that in theory supports also circular native cropping on Android via (https://github.com/Yalantis/uCrop) and iOS via (https://github.com/TimOliver/TOCropViewController) and the used package https://pub.dev/packages/image_cropper also mentions support for it. However, I just tried it on Android via a quick test to see if it works with:

ImageCropper.cropImage(
                  cropStyle: CropStyle.circle,

But I was still getting square/rectangular shaped images, at least when I tried it as used in the advance_image_picker.

The cropper shows circular cropping (in rectangle or square fitted into selected aspect ratio):

circular cropper

But all I saw were rectangular crops as a result anyway (at least on an Android Pixel 4XL emulator). I would need to experiment and look into it a bit more. However, advance_image_picke package owner and creator @weta-vn might have some more immediate insights into this.

weta-vn commented 3 years ago

Thanks @rydmike As @rydmike explained, we use image_cropper package without editing it. We're have not plan to customize it, but in the future, we can consider to support it. If you have idea for this, please discuss together. Thank you very much.