diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index dc3d32b38..00fb81145 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -76,13 +76,21 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } private fun resizeImage() { - val rect = crop_image_view.cropRect - val croppedSize = Point(rect.width(), rect.height()) - ResizeDialog(this, croppedSize) { + ResizeDialog(this, getAreaSize()) { } } + private fun getAreaSize(): Point { + val rect = crop_image_view.cropRect + val rotation = crop_image_view.rotatedDegrees + return if (rotation == 0 || rotation == 180) { + Point(rect.width(), rect.height()) + } else { + Point(rect.height(), rect.width()) + } + } + override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) { if (result.error == null) { if (uri.scheme == "file") {