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

Editor Crashing When Sticker is Larger Than Image or Placed Outside Image #74

Open
YashM20 opened this issue Jul 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@YashM20
Copy link

YashM20 commented Jul 8, 2024

Issue: Editor Crashing When Sticker is Larger Than Image or Placed Outside Image

Description:
The photo editor crashes when a sticker is either larger than the image itself or placed outside the image boundaries. This issue disrupts the editing experience and requires a restart of the app to recover.

Environment:

  • React: 17.0.2
  • React Native: 0.68.7
  • @baronha/react-native-photo-editor: ^1.1.6
  • Device/OS: Android

Steps to Reproduce:

  1. Open the photo editor.
  2. Add an landscape image to edit.
  3. Select a sticker and place it on the image.
  4. Resize the sticker to be larger than the image or move the sticker outside the image boundaries.
  5. Observe the crash.

Expected Behavior:
The photo editor should handle stickers gracefully, even if they are larger than the image or placed outside the image boundaries. It should not crash, sticker should get cropped accordingky

Actual Behavior:
The photo editor crashes when a sticker is resized to be larger than the image or placed outside the image boundaries.

Screenshots/Video:

MicrosoftTeams-video.mp4

Logs:
native exception java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$4.done(AsyncTask.java:415)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
at java.util.concurrent.FutureTask.run(FutureTask.java:269)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 0
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at android.view.ViewGroup.getAndVerifyPreorderedView(ViewGroup.java:3811)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4342)
at android.view.View.draw(View.java:23699)
at android.view.ViewGroup.drawChild(ViewGroup.java:4586)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4344)
at android.view.View.draw(View.java:23850)
at ja.burhanrashid52.photoeditor.PhotoSaverTask.captureView(PhotoSaverTask.java:161)
at ja.burhanrashid52.photoeditor.PhotoSaverTask.buildBitmap(PhotoSaverTask.java:104)
at ja.burhanrashid52.photoeditor.PhotoSaverTask.saveImageInFile(PhotoSaverTask.java:88)
at ja.burhanrashid52.photoeditor.PhotoSaverTask.doInBackground(PhotoSaverTask.java:70)
at ja.burhanrashid52.photoeditor.PhotoSaverTask.doInBackground(PhotoSaverTask.java:23)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)

@Neelshah768
Copy link

I am also facing same issue.

@baronha
Copy link
Owner

baronha commented Jul 9, 2024

I will look into it ASAP. Thank you for trusting this library.

@Pinky-Billava
Copy link

I'm experiencing the same problem as well

@baronha baronha self-assigned this Jul 30, 2024
@baronha baronha added the bug Something isn't working label Jul 30, 2024
@Pinky-Billava
Copy link

@baronha Any update on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants