image_crop icon indicating copy to clipboard operation
image_crop copied to clipboard

Not able to crop image

Open ashifa454 opened this issue 4 years ago • 1 comments

When I am calling ImageCrop.sampleImage it's crashing my application

Stop reading file since a wrong offset may cause an infinite loop: 0
E/AndroidRuntime(28321): FATAL EXCEPTION: pool-1-thread-1
E/AndroidRuntime(28321): Process: com.example.lokbol, PID: 28321
E/AndroidRuntime(28321): java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File android.app.Activity.getCacheDir()' on a null object reference
E/AndroidRuntime(28321): 	at com.lykhonis.imagecrop.ImageCropPlugin.createTemporaryImageFile(ImageCropPlugin.java:341)
E/AndroidRuntime(28321): 	at com.lykhonis.imagecrop.ImageCropPlugin.access$200(ImageCropPlugin.java:39)
E/AndroidRuntime(28321): 	at com.lykhonis.imagecrop.ImageCropPlugin$2.run(ImageCropPlugin.java:226)
E/AndroidRuntime(28321): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(28321): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(28321): 	at java.lang.Thread.run(Thread.java:764)
W/OPDiagnose(28321): getService:OPDiagnoseService NULL

Please consider these logs

ashifa454 avatar May 02 '20 19:05 ashifa454

This bug is still happening on version 0.4.1

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File android.app.Activity.getCacheDir()' on a null object reference at com.lykhonis.imagecrop.ImageCropPlugin.createTemporaryImageFile(ImageCropPlugin.java:395) at com.lykhonis.imagecrop.ImageCropPlugin.access$200(ImageCropPlugin.java:44) at com.lykhonis.imagecrop.ImageCropPlugin$1.run(ImageCropPlugin.java:217) 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:919)

Android 10 - moto e(7) power Android 12 - Galaxy A02s Android 10 - Galaxy J6

walteram avatar Sep 19 '22 18:09 walteram