Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Canvas: trying to draw too large bitmap. #5

Open
ErrrorMaxx opened this issue Jan 17, 2024 · 1 comment

Comments

@ErrrorMaxx
Copy link

When trying to load photo made by my phone (64MP, 6912x9216px), Perspective crashes with this error:

java.lang.RuntimeException: Canvas: trying to draw too large(254803968bytes) bitmap.
	at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:266)
	at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:94)
	at com.dan.perspective.TouchImageView.onDraw(Unknown Source:96)
	at com.dan.perspective.EditPerspectiveImageView.onDraw(Unknown Source:0)
	at android.view.View.draw(View.java:23354)
	at android.view.View.updateDisplayListIfDirty(View.java:22181)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(Unknown Source:30)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.updateDisplayListIfDirty(View.java:22172)
	at android.view.View.draw(View.java:23071)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4619)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4380)
	at android.view.View.draw(View.java:23361)
	at com.android.internal.policy.DecorView.draw(DecorView.java:847)
	at android.view.View.updateDisplayListIfDirty(View.java:22181)
	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:682)
	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:688)
	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:786)
	at android.view.ViewRootImpl.draw(ViewRootImpl.java:4890)
	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4589)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3792)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2519)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9516)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1326)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1334)
	at android.view.Choreographer.doCallbacks(Choreographer.java:967)
	at android.view.Choreographer.doFrame(Choreographer.java:881)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1309)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:204)
	at android.os.Looper.loop(Looper.java:291)
	at android.app.ActivityThread.main(ActivityThread.java:8129)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)

P.S. Android 13, F-Droid build

@pempek
Copy link

pempek commented May 6, 2024

I believe I'm experiencing similar issue.

Whenever I try to open a 40MP image, the app immediately crashes.

Android 14, One UI 6.1, app v1.17; f-droid build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants