You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
After applying crop, toast "Error while saving image" is displayed.
Problem is probably in CropFragment , line 201: Single.fromCallable(() -> cropPanel.getCroppedImage());
method getCroppedImage is called from background thread, but it should not, because it works with view (mImageView.clearAnimation())
This problem does not happens on all devices, reproduced on Galaxy Tab S2 , Android 7
Stacktrace:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7831)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1342)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5449)
at android.view.View.invalidateInternal(View.java:14807)
at android.view.View.invalidate(View.java:14771)
at android.view.View.invalidateParentIfNeeded(View.java:14960)
at android.view.View.clearAnimation(View.java:21431)
at com.theartofdev.edmodo.cropper.CropImageView.getCroppedImage(CropImageView.java:763)
at com.theartofdev.edmodo.cropper.CropImageView.getCroppedImage(CropImageView.java:737)
at iamutkarshtiwari.github.io.ananas.editimage.fragment.crop.CropFragment.lambda$getCroppedBitmap$4$CropFragment(CropFragment.java:201)
at iamutkarshtiwari.github.io.ananas.editimage.fragment.crop.-$$Lambda$CropFragment$Y_hl9FvcrZ26G-Bb-gpLHqbxGQw.call(lambda)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
at io.reactivex.Single.subscribe(Single.java:3575)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
The text was updated successfully, but these errors were encountered:
After applying crop, toast "Error while saving image" is displayed.
Problem is probably in CropFragment , line 201: Single.fromCallable(() -> cropPanel.getCroppedImage());
method getCroppedImage is called from background thread, but it should not, because it works with view (mImageView.clearAnimation())
This problem does not happens on all devices, reproduced on Galaxy Tab S2 , Android 7
Stacktrace:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7831)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1342)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5449)
at android.view.View.invalidateInternal(View.java:14807)
at android.view.View.invalidate(View.java:14771)
at android.view.View.invalidateParentIfNeeded(View.java:14960)
at android.view.View.clearAnimation(View.java:21431)
at com.theartofdev.edmodo.cropper.CropImageView.getCroppedImage(CropImageView.java:763)
at com.theartofdev.edmodo.cropper.CropImageView.getCroppedImage(CropImageView.java:737)
at iamutkarshtiwari.github.io.ananas.editimage.fragment.crop.CropFragment.lambda$getCroppedBitmap$4$CropFragment(CropFragment.java:201)
at iamutkarshtiwari.github.io.ananas.editimage.fragment.crop.-$$Lambda$CropFragment$Y_hl9FvcrZ26G-Bb-gpLHqbxGQw.call(lambda)
at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)
at io.reactivex.Single.subscribe(Single.java:3575)
at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
The text was updated successfully, but these errors were encountered: