Giter VIP home page Giter VIP logo

Comments (5)

ArthurHub avatar ArthurHub commented on July 19, 2024

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.

spartacus777 avatar spartacus777 commented on July 19, 2024

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.

Rainer-Lang avatar Rainer-Lang commented on July 19, 2024

Maybe your modifications helps the project...

from android-image-cropper.

xitij avatar xitij commented on July 19, 2024

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.

ArthurHub avatar ArthurHub commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.