Comments (5)
If you create a pull request I will merge it.
Are you sure API 17-19 has this issue?
Unfortunately I don't have the time to check it, can you make sure it is necessary up to API 19, I would really prefer not to disable hardware rendering if it is not necessary.
Thx for you time and effort, really appreciate it.
from android-image-cropper.
Not definetly sure, I will dot it while testing my whole app in a couple month. But from 5 android it works 100%, also I saw it worked on android 4.4, Samsung Tab 3
I can not create pull requestm since i intergated your code into my project and made a huge modifications to it (a lots of redesign work major)
But actually tou have jsut to add what i wrote above, and it should work
from android-image-cropper.
Maybe your modifications helps the project...
from android-image-cropper.
Hi, I've noticed this issue as well when using the Oval crop tool. I get the following crash when attempting to load a photo from the gallery with a Oval crop tool:
E/AndroidRuntime: FATAL EXCEPTION: main
E/AndroidRuntime: java.lang.IllegalStateException: Underflow in restore - more restores than saves
E/AndroidRuntime: at android.graphics.Canvas.native_restore(Native Method)
E/AndroidRuntime: at android.graphics.Canvas.restore(Canvas.java:540)
E/AndroidRuntime: at com.theartofdev.edmodo.cropper.cropwindow.CropOverlayView.drawBackground(CropOverlayView.java:558)
E/AndroidRuntime: at com.theartofdev.edmodo.cropper.cropwindow.CropOverlayView.onDraw(CropOverlayView.java:314)
E/AndroidRuntime: at android.view.View.draw(View.java:16178)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15174)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.draw(View.java:16181)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15174)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15169)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15169)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15169)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15169)
E/AndroidRuntime: at android.view.View.draw(View.java:15948)
E/AndroidRuntime: at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
E/AndroidRuntime: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
E/AndroidRuntime: at android.view.View.draw(View.java:16181)
E/AndroidRuntime: at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
E/AndroidRuntime: at android.view.View.updateDisplayListIfDirty(View.java:15174)
E/AndroidRuntime: at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
E/AndroidRuntime: at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
E/AndroidRuntime: at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
E/AndroidRuntime: at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
E/AndroidRuntime: at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
E/AndroidRuntime: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
E/AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
E/AndroidRuntime: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
E/AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
E/AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:606)
E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
The issue is in CropOverlayView
in drawBackground(...)
, canvas.restore()
is called without a canvas.save()
I submitted a PR for this issue.
from android-image-cropper.
finally added you fix in 1.0.7 version.
from my tests the fix is required up to API version 17 and not 19 (test 18 on emulator and 19 on nexus 5)
Thank you for you help with this.
from android-image-cropper.
Related Issues (20)
- error in manifest about CropImageActivity HOT 1
- Native crash in "libc.so tgkill" at SupportRequestManagerFragment HOT 1
- activity is not found in project or libraies AndroidManifest.xml HOT 1
- The camera not working above android version 11.. HOT 5
- Start Activity with request code HOT 1
- RLÒP?PPÒÌUIUYYYTTTTTRRRÀ¹³⁴¹1L2J⁴⁶⁶⁷⁸⁹⁰=/ HOT 1
- The bottom of the cropped image is not fully displayed HOT 1
- Class referenced in the manifest was not found in the project or the libraries HOT 2
- The dependencies are not found in android 12 HOT 1
- Camera Issues (Android 11 and 12) HOT 6
- Cropped picture clarity is so poor HOT 3
- Could not find com.hendraanggrian.appcompat:socialview:0.3. Required by: project :app Search in build.gradle files HOT 2
- pick from google drive HOT 1
- Not showing any other options but opening camera only HOT 1
- i cant use the crop image !! HOT 1
- Unable to use images from camera HOT 3
- Error while importing HOT 6
- Veracode - vulnerabilities
- i can't build HOT 1
- cant use preview camera view on this cropper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-image-cropper.