ArthurHub / Android-Image-Cropper

Image Cropping Library for Android, optimized for Camera / Gallery.
Apache License 2.0
6.39k stars 1.36k forks source link

Question #760

Open brahimoulhaj opened 4 years ago

brahimoulhaj commented 4 years ago

Hello, thank you for this beautiful library. Please a have a question, is there any way to make the dimensions same (width = height) when cropping the image ? thank you

AminTakhtiNejad commented 4 years ago

Hey though a bit late but someone else might find this useful

you can use"setAspectRatio(1,1)". using this method you can force same width and height i.e 1:1 aspect ratio.

            CropImage.activity()
                    .setGuidelines(CropImageView.Guidelines.ON)
                    .setCropMenuCropButtonIcon(R.drawable.checked)
                    **.setAspectRatio(1,1)**
                    .start(this)
brahimoulhaj commented 4 years ago

Thank you so much

On Wed, Aug 12, 2020 at 9:15 PM Amin Takhti Nejad notifications@github.com wrote:

Hey though a bit late but someone else might find this useful

you can use"setAspectRatio(1,1)". therefore you force same width and height or a 1:1 aspect ratio.

        CropImage.activity()
                .setGuidelines(CropImageView.Guidelines.ON)
                .setCropMenuCropButtonIcon(R.drawable.checked)
                **.setAspectRatio(1,1)**
                .start(this)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ArthurHub/Android-Image-Cropper/issues/760#issuecomment-673087816, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCAIVCCB536KBIXRBMXOKLSALZ4RANCNFSM4NC2BE7A .

Canato commented 3 years ago

Hey!

I start a new project to handover this library https://github.com/CanHub/Android-Image-Cropper

The ideia is that we keep improving because this project don’t have updates since 2018 Hope I can count with your help.

Open to contribute, next pieces of work will be Android 11 permissions, refactor into Kotlin and ActivityContract