status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
296 stars 78 forks source link

[Wallet - Token management] Webp collectibles are not animated #12949

Open alexjba opened 10 months ago

alexjba commented 10 months ago

Description

Qt fails to load webp animations from network. It seems to be a known issue, fixed in Qt6 (https://bugreports.qt.io/browse/QTBUG-75044).

We have a fallback implemented in StatusAnimatedImage and a static image is presented instead. A workaround for this issue would be to download the image on disk before loading it in the StatusAnimatedImage.

Repro steps:

It can be easily reproduced in storybook. Go to ManageCollectiblesModel.qml and add an address pointing to a webp asset as mediaUrl and 'image' as mediaType. E.g.

        {
            uid: "pp21",
            name: "pepepunk#21",
            collectionUid: "pepepunks",
            collectionName: "",
            communityId: "",
            communityName: "",
            mediaUrl: "https://i.seadn.io/gae/TX0qOy8g8ibx1p2gQzWIM3Kvsy4a447ti2ZtMlcJmRFM8PU_4YYw2WMpKvO_bnqJiDj2Y7njP6d0tf2YG_K-yYDN2gdbEA2dsOXJsA?w=500&auto=format",
            mediaType: "image",
            isLoading: false,
            backgroundColor: ""
        }

Open CollectiblesViewPage

Expected: The asset is visible and animated

Actual: The asset is a static image

          > > * I've added a few watch accounts and I see some popular NTFs use webp encoding. It seems we can't play webp images from the network.

I've been briefly looked into this an I think this is the issue https://bugreports.qt.io/browse/QTBUG-75044. It was fixed in qt6, so it's not helpful in our case. If we really need to support webp formats, I think we need an alternative. It seems to be working fine if we're downloading the image before loading it in the StatusAnimatedImage. @caybro WDYT of this?

Dunno, I don't think we support it

Warning: qrc:/StatusQ/Components/StatusAnimatedImage.qml:24:1: QML StatusAnimatedImage: Error Reading Animated Image File https://i.seadn.io/gae/TX0qOy8g8ibx1p2gQzWIM3Kvsy4a447ti2ZtMlcJmRFM8PU_4YYw2WMpKvO_bnqJiDj2Y7njP6d0tf2YG_K-yYDN2gdbEA2dsOXJsA?w=500&auto=format (qrc:/StatusQ/Components/StatusAnimatedImage.qml:24, )

Hmm and here it looks like it doesn't like the query part of the URL (needs to be stripped maybe)?

I've tried it with other urls and I've seen the same result. Not a big deal IMHO because we have a fallback that's loading a static image instead. But it's something we can fix (probably in 0.16 if it's important enough). It's reproducible in storybook as well by adding any webp url as mediaUrl and mediaType: "image" in the ManageCollectiblesModel.qml.

I'll create another issue for it.

Originally posted by @alexjba in https://github.com/status-im/status-desktop/issues/12917#issuecomment-1841200379

iurimatias commented 8 months ago

moved to 2.29 due to lack of space in this milestone

noeliaSD commented 6 months ago

Moved to next milestone due to team capacity and priorities.