burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.12k stars 989 forks source link

Image Breaking Orientation After Filter #394

Closed muslimmuda15 closed 2 years ago

muslimmuda15 commented 2 years ago

I want to change the orientation of image after shot from camera from portrait into landscape. So I need to rotation and reduce scale the view like this

photoEditor = PhotoEditor
            .Builder(requireContext(), binding.photoEditorView)
            .build()

with(binding.photoEditorView) {
      if (ImageList.images.size > 0) {
          Glide.with(this.source)
              .asBitmap()
              .load(bitmapSource)
              .into(this.source)
      }

      this.rotation = 270F
      this.scaleX = 0.6
      this.scaleY = 0.6
}

The result was correct

Screenshot_2021-09-16-22-20-34-00

I try to filter the image

photoEditor.setFilterEffect(PhotoFilter.AUTO_FIX)

I getting the image is breaking like this

Screenshot_2021-09-16-22-20-48-02

burhanrashid52 commented 2 years ago

You are rotating the whole drawing view i.e PhotoEditorView. If you want to rotate the image the get ImageView from photoEditorView.getSource() and applying to rotation to that.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 4 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity.