Open alirezabashi98 opened 3 years ago
@HuuNguyen312 Thanks for the feature implementation, but is has a bug. Image don't flip when you don't rotate it and just flip it directly and then save.
Here is what you need to do,
Just put this line in shouldCrop()
method located in BitmapCropTask.Java
.
if (flipHorizontally) return true;
The complete code would be:
private boolean shouldCrop(int width, int height) {
int pixelError = 1;
pixelError += Math.round(Math.max(width, height) / 1000f);
if (flipHorizontally) return true;
return (mMaxResultImageSizeX > 0 && mMaxResultImageSizeY > 0)
|| Math.abs(mCropRect.left - mCurrentImageRect.left) > pixelError
|| Math.abs(mCropRect.top - mCurrentImageRect.top) > pixelError
|| Math.abs(mCropRect.bottom - mCurrentImageRect.bottom) > pixelError
|| Math.abs(mCropRect.right - mCurrentImageRect.right) > pixelError
|| mCurrentAngle != 0;
}
I added flip feature. You can try it at https://github.com/HuuNguyen312/uCrop