lottie-flutter
lottie-flutter copied to clipboard
Fix: normalize absolute image paths in composition loading
This PR fixes an issue where image paths inside the composition could start with a leading slash (/), causing them not to match entries in the archive.
Expected: images/bg.png
Got: /images/bg.png
As a result, the image wasn’t found and failed to load.
We now check if the joined path is absolute using p.posix.isAbsolute(imagePath) and remove the leading slash when needed:
if (p.posix.isAbsolute(imagePath)) {
imagePath = imagePath.substring(1);
}