Fresco: animated-gif package breaks downloadable gifs with rounding

Created on 18 Oct 2019  路  7Comments  路  Source: facebook/fresco

Description

I'm using com.facebook.fresco:fresco and com.facebook.fresco:animated-gif for show animated gif.
I load a gif image (non animated) from the Internet and apply RoundingParams.
I expect to see round image, but I get square.
Gifs from app resources work fine.
I need animated-gif package for animation, but how to disable it for non animated gifs?

Reproduction

If enable animated-gif package then RoundingParams will broken but animation will worked fine.

Solution

Disabling animated-gif package resolve problem, but all animated gifs break.

Additional Information

  • Fresco version: 2.0.0
  • animated-gif: 2.0.0
  • Platform version: any device
question

All 7 comments

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.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.

The problem still exist!

Hey! How can we reproduce the issue? Can you give us some sample code? Rounding for GIFs is currently not supported.

@oprisnik The problem is in use fresco's and animated-gif's dependencies at the same time.
I use fresco for show user photo which is one-frame gif without animation and round it in user list. And I use fresco for show animated gifs. Both (user photo and funny gifs) are loading from the Internet. But with animated-gif fresco doesn't round user photo gif.
I can create demo project for you during several days.

Oh, that explains the issue.
When you include animated-gif, we'll use the animated GIF decoder for the image, which does not support rounding. For a single frame GIF, the system can decode a static image (which is happening when you don't have animated-gif).

The solution to this problem is to supply this method:

ImageDecodeOptions options = ImageDecodeOptions.newBuilder().setForceStaticImage(true).build();
// Pass the options to the Drawee view via a DraweeController
draweeControllerBuilder.setImageRequest(
          ImageRequestBuilder.newBuilderWithSource(uri)
              .setImageDecodeOptions(options)
              .build());

@oprisnik thanks, it's working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goodev picture goodev  路  4Comments

satyarths picture satyarths  路  3Comments

qiiyue picture qiiyue  路  4Comments

kingty picture kingty  路  4Comments

bigfreeZhou picture bigfreeZhou  路  4Comments