lottie-flutter icon indicating copy to clipboard operation
lottie-flutter copied to clipboard

Fix: normalize absolute image paths in composition loading

Open oiesc opened this issue 1 month ago • 0 comments

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);
}

oiesc avatar Nov 06 '25 21:11 oiesc