facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.07k stars 3.75k forks source link

bug: App crashes while loading very large gif image using Fresco #2595

Open Artemych opened 3 years ago

Artemych commented 3 years ago

Hello. My app crashes while trying to draw very large gif image. It could be reproduced at any device or android os version.

Resize options is set to the the ImageRequestBuilder and it is smth like 1080x768px while image size is 6743x4654px.

Also i tried to apply ImagePipelineExperiments.Builder.setShouldDownscaleFrameToDrawableDimensions but it has no effect on it.

Stack trace: Caused by java.lang.RuntimeException: Canvas: trying to draw too large(125527688bytes) bitmap. at android.graphics.RecordingCanvas.throwIfCannotDraw(RecordingCanvas.java:280) at android.graphics.BaseRecordingCanvas.drawBitmap(BaseRecordingCanvas.java:88) at com.facebook.fresco.animation.bitmap.BitmapAnimationBackend.drawBitmapAndCache(BitmapAnimationBackend.java:332) at com.facebook.fresco.animation.bitmap.BitmapAnimationBackend.drawFrameOrFallback(BitmapAnimationBackend.java:209) at com.facebook.fresco.animation.bitmap.BitmapAnimationBackend.drawFrameOrFallback(BitmapAnimationBackend.java:228) at com.facebook.fresco.animation.bitmap.BitmapAnimationBackend.drawFrameOrFallback(BitmapAnimationBackend.java:228) at com.facebook.fresco.animation.bitmap.BitmapAnimationBackend.drawFrame(BitmapAnimationBackend.java:157) at com.facebook.fresco.animation.backend.AnimationBackendDelegate.drawFrame(AnimationBackendDelegate.java:54) at com.facebook.fresco.animation.backend.AnimationBackendDelegateWithInactivityCheck.drawFrame(AnimationBackendDelegateWithInactivityCheck.java:107) at com.facebook.fresco.animation.drawable.AnimatedDrawable2.draw(AnimatedDrawable2.java:213) at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:185) at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:185) at com.facebook.drawee.drawable.ScaleTypeDrawable.draw(ScaleTypeDrawable.java:145) at com.facebook.drawee.drawable.FadeDrawable.drawDrawableWithAlpha(FadeDrawable.java:328) at com.facebook.drawee.drawable.FadeDrawable.draw(FadeDrawable.java:313) at com.facebook.drawee.drawable.ForwardingDrawable.draw(ForwardingDrawable.java:185) at com.facebook.drawee.generic.RootDrawable.draw(RootDrawable.java:83) at android.widget.ImageView.onDraw(ImageView.java:1416)

File sample: https://disk.yandex.ru/d/k3zq96kx3m3oeA

stale[bot] commented 2 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

mahuiyuan commented 2 years ago

I have the same problem