Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop window reset when image is rotated. #935

Open
shgrg1712 opened this issue Dec 16, 2024 · 0 comments
Open

Crop window reset when image is rotated. #935

shgrg1712 opened this issue Dec 16, 2024 · 0 comments

Comments

@shgrg1712
Copy link

shgrg1712 commented Dec 16, 2024

Do you want to request a feature or report a bug?
Feature
What is the current behavior?
First Issue : On Image rotate, image is getting zoom in to fit the dimensions of crop window. But on rotate back to original image orientation,Image still in Zoom in mode. So fix this issue set the scale multiplier to 1.0001f.
Pre-Condition : Set Scale multiplier to 1.0001f to avoid image scaling/zoom while rotation.
When we rotate an image with rectangular dimensions then crop window is not getting adjusted based on new dimensions of image after rotation
What is the expected behavior?
Pre-Condition : Set Scale multiplier to 1.0001f to avoid image scaling/zoom while rotation.
When we rotate an image with rectangular dimensions then crop window should get adjusted based on new dimensions of image after rotation.
In whatsapp on crop window, if we rotate the image then it rotate the crop window with image.
So image should not get scale on rotation rather crop window should get adjusted as per dimensions of image after rotation
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Pre-Condition : Set Scale multiplier to 1.0001f to avoid image scaling/zoom while rotation.
Steps

  1. Open one image from gallery.
  2. Rotate the image 90 degrees
  3. When crop window is out of image bounds then press the tick or ok button at top.

Observe: Crop failure error.
Please attach any image files, URL and stack trace that can be used to reproduce the bug.
Test_Image

**Which versions of uCrop, and which Android API versions are affected by this issue? Did this work in previous versions of uCrop?
UCrop Version : 2.2.8
Android Target SDK 34

These are the parameters set to launch UCropFragment

// Set the source image URI (file path or content URI)
uCropBundle.putParcelable(UCrop.EXTRA_INPUT_URI, sourceUri);
// Set the destination image URI (where the cropped image will be saved)
uCropBundle.putParcelable(UCrop.EXTRA_OUTPUT_URI, destinationUri);
// Set the UCrop.Options in the Bundle
uCropBundle.putInt(UCrop.Options.EXTRA_COMPRESSION_QUALITY, 100);
uCropBundle.putBoolean(UCrop.Options.EXTRA_FREE_STYLE_CROP, true);
uCropBundle.putBoolean(UCrop.Options.EXTRA_HIDE_BOTTOM_CONTROLS, false);
uCropBundle.putFloat(UCrop.Options.EXTRA_MAX_SCALE_MULTIPLIER, 1.0001f);
uCropBundle.putIntArray(UCrop.Options.EXTRA_ALLOWED_GESTURES,new int[]{UCropActivity.ROTATE, UCropActivity.SCALE});
uCropBundle.putInt(UCrop.Options.EXTRA_UCROP_COLOR_CONTROLS_WIDGET_ACTIVE, mActivity.getColor(R.color.colorPrimary));
uCropBundle.putFloat(UCrop.EXTRA_ASPECT_RATIO_X,0);
uCropBundle.putFloat(UCrop.EXTRA_ASPECT_RATIO_Y,0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant