Hello David, thank you for the add-on, a very useful one.
I’m encountering a problem related to the following:
I want to get the cropped image and store it somewhere in the file system. I have used the code found in your example.
When I put the cropped image in a byte array
cropButton.addClickListener(event → {
dialog.close();
String imageUri = crop.getImageUri();
Image img = new Image();
img.setSrc(imageUri);
byte[] data = crop.getImageBase64();
the last line throws an exception:
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at de.f0rce.cropper.Cropper.getImageBase64(Cropper.java:96) ~[cropperjs-1.0.0-Beta.jar:1.0.0-Beta]
This happens randomly, lets say round 40% of the cases and I cannot understand why.
Can you please help me on this?
Thank you in advance.