fluttercandies / flutter_image_editor

Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Apache License 2.0
419 stars 129 forks source link

PlatformException(java.lang.IllegalArgumentException: x + width must be <= bitmap.width() #87

Closed louisdeveseleer closed 2 years ago

louisdeveseleer commented 2 years ago

This happends only for our Android users and is triggered here in Flutter: channel.dart in NativeChannel.memoryToMemory at line 39 within image_editor

Here is the full message:

PlatformException(java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
    at android.graphics.Bitmap.createBitmap(Bitmap.java:858)
    at p.a.a.c.f.d(ImageHandler.kt:3)
    at p.a.a.c.f.c(ImageHandler.kt:5)
    at p.a.a.a.k(FlutterImageEditorPlugin.kt:3)
    at p.a.a.a.c(FlutterImageEditorPlugin.kt:1)
    at p.a.a.a$b.run(FlutterImageEditorPlugin.kt:18)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:920)
, , null, null)
CaiJingLong commented 2 years ago

As in the tip, the x + width of the option set when cropping an image cannot exceed the width of the image Similarly, y + height cannot exceed the height of the image