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

Use fitCenter() in GlideImagePlugin #456

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Conversation

luk1337
Copy link
Member

@luk1337 luk1337 commented Nov 29, 2021

AniTrend Pull Request

Thank you for contributing! Please take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.

Please open an issue before embarking on any significant pull request, especially those that
add a new library or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.

Before opening a pull request, please ensure:

  • You have followed our contributing guidelines
  • double-check your branch is based on develop and targets develop
  • Pull request has tests
  • Code is well-commented, linted and follows project conventions
  • Documentation is updated (if necessary)
  • Description explains the issue/use-case resolved
  • I did not commit files that are excluded in the .gitignore file (Happens if you stage files with Android Studio)

Description

Motivation and Context

11-29 12:44:17.389 28234 28234 E AndroidRuntime: FATAL EXCEPTION: main
11-29 12:44:17.389 28234 28234 E AndroidRuntime: Process: com.mxt.anitrend, PID: 28234
11-29 12:44:17.389 28234 28234 E AndroidRuntime: java.lang.RuntimeException: Canvas: trying to draw too large(311040000bytes) bitmap.
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:280)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:88)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:548)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at io.noties.markwon.image.AsyncDrawable.draw(AsyncDrawable.java:326)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at io.noties.markwon.image.AsyncDrawableSpan.draw(AsyncDrawableSpan.java:126)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.text.TextLine.handleReplacement(TextLine.java:1011)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.text.TextLine.handleRun(TextLine.java:1158)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.text.TextLine.drawRun(TextLine.java:491)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.text.TextLine.draw(TextLine.java:286)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.text.Layout.drawText(Layout.java:576)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.widget.Editor.drawHardwareAcceleratedInner(Editor.java:2107)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.widget.Editor.drawHardwareAccelerated(Editor.java:2026)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.widget.Editor.onDraw(Editor.java:1966)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.widget.TextView.onDraw(TextView.java:8044)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22350)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22353)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22353)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at androidx.core.widget.NestedScrollView.draw(NestedScrollView.java:1998)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22353)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at androidx.viewpager.widget.ViewPager.draw(ViewPager.java:2426)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22353)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.389 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21217)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22081)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.View.draw(View.java:22353)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at com.android.internal.policy.DecorView.draw(DecorView.java:806)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.View.updateDisplayListIfDirty(View.java:21226)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewRootImpl.draw(ViewRootImpl.java:4106)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3833)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3104)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1948)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8177)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:796)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:731)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7664)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
11-29 12:44:17.390 28234 28234 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

How Has This Been Tested?

Load https://anilist.co/user/Kosuna, see that it doesn't crash anymore.

Screenshots (if appropriate):

n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

IMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the MIT License.

...Otherwise we hit exception because bitmap size is too high.
@wax911
Copy link
Member

wax911 commented Nov 29, 2021

Thanks @luk1337 ❤️

@wax911 wax911 merged commit 91a8742 into AniTrend:develop Nov 29, 2021
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

Successfully merging this pull request may close these issues.

2 participants