mrousavy / mrousavy/react-native-nitro-image

Are animated images like webp or gif supported on Android?

Open
#100 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
652
Forks
37
Avg merge
56m
Merged PRs (30d)
6

Description

Hi team! I'm trying to integrate Nitro Image into our app but I ran into some issues. To narrow it down, I created simple Expo App and installed nitro image there. While ios is working fine, on Android I'm hitting error Requested Image is not a Bitmap! when trying to load remote animated gif. I got the same issue with animated webp.

To reproduce I just did in my component:

 const gifImage = useImage({
    url: "https://www.easygifanimator.net/images/samples/imageeffects.gif",
  });
. . .
{gifImage.image && (
        <NitroImage
          image={gifImage.image}
          style={{ width: 200, height: 200 }}
        />
      )}

Is this something on my side? I understand that Coil should support animated image: https://coil-kt.github.io/coil/gifs/ if AnimatedImageDecoder is loaded. The error I'm getting is throw from here: https://github.com/mrousavy/react-native-nitro-image/blob/main/packages/react-native-nitro-web-image/android/src/main/java/com/margelo/nitro/web/image/ImageLoader%2BloadImageAsync.kt#L34
Is react-native-nitro-web-image preventing animated images?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Android loader at packages/react-native-nitro-web-image/android/src/main/java/com/margelo/nitro/web/image/ImageLoader+loadImageAsync.kt:34 and reproduce the issue in the supplied Expo component with the remote GIF and animated WebP. Check how Coil is configured, including whether AnimatedImageDecoder is loaded. Done means animated GIF and WebP images render on Android without the “Requested Image is not a Bitmap!” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.