I'm using the pokeApi for my app. Each element has a Sprites object that contain different kinds of images. All have 8-bit-like PNG images (let's call them low-res), but about half of them also have quite better looking SVG images (let's call them hi-res). I want my grid elements to show hi-res sprites whenever possible, and low-res when the first attempt failed (because the url links to nothing).
I've searched and found this question: How to set an image URL as error placeholder on Coil in Jetpack Compose However, it uses deprecated code that's not compatible with my current code. If I try to use AsyncImage like that question's accepted answer, I lose the SVG rendering - and since it was a successful download, it's just a blank area where the sprite should be. If I try with SubcomposeAsyncImage, I get the SVG allright, but when I scroll to those I know have no SVG sprites I just get blank (because the error state isn't loading the fallback PNG sprite).
Is there an up-to-date way to do what I intend and accomodates both SVG and PNG formats?
[Edit: rephrasing and removing typo]