Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.86k stars 2.16k forks source link

setCircleDimmedLayer does not crop the picture as a square #225

Closed vanniktech closed 7 years ago

vanniktech commented 7 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? When cropping an image using the setCircleDimmedLayer(true) the output image covers the entire screen and is a rectangle.

What is the expected behavior? I'd expect to get a quadratic image back.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Choose a picture
  2. Crop it with the option setCircleDimmedLayer(true).
  3. Look at the output and verify that the behavior is not the expected one

Please attach any image files, URL and stack trace that can be used to reproduce the bug. This patch can be applied on top of master to reproduce this bug:

diff --git a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java
index ff1fe07..0649939 100644
--- a/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java
+++ b/sample/src/main/java/com/yalantis/ucrop/sample/SampleActivity.java
@@ -271,6 +271,7 @@ public class SampleActivity extends BaseActivity {
         options.setHideBottomControls(mCheckBoxHideBottomControls.isChecked());
         options.setFreeStyleCropEnabled(mCheckBoxFreeStyleCrop.isChecked());

+        options.setCircleDimmedLayer(true);
         /*
         If you want to configure how gestures work for all UCropActivity tabs

Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop? Affected is: 2.2.0 plus current master

vanniktech commented 7 years ago

Friendly ping @Cool04ek

TeeRawk commented 7 years ago

Hello @vanniktech , I don't quite understand the issue. Maybe you can provide a screenshot and explain ,please ?

vanniktech commented 7 years ago

@teerawk activate circle dimmed layer using setCircleDimmedLayer(true) then crop an image. It'd be expected to get a square cropped image however you'll get a rectangle image.

vanniktech commented 7 years ago

Not interested anymore.