Importing GIF as imagetable loses frame

Using the SDK 2.0.0 on MacOS
I made the attached GIF in Photoshop (using File->Export->Save for Web). It plays fine in QuickLook and every GIF-viewing tool I have easy access to.
I import it into the project using graphics.imagetable.new(gifFilename), and it seems to draw a blank frame for frame 3.
In the pdx bundle, the pdt file that gets generated has a nearly-blank frame 3. It seems to contain only the delta against frame 1.

GIF:
cabinet

@dave are you aware of this one?

I know there's something off in our animated gif decoding, one of the card animations Christina made for Forrest Byrnes had weird artifacts that I couldn't sort out. This gif is weird. It has full images for frames 1, 4, 5, and 6, a sub-image delta for frame 2, and a full-image delta for 3. Its frame disposal methods don't really make sense--it looks like it's saying to composite frame 2 over frame 1 (makes sense) but to replace the image for the rest of the frames (doesn't make sense for frame 3). I'll see if I can find some gif rendering code online to see how it deals with this.

In the mean time I think your best bet is to turn off optimizations in your authoring tool, if possible, so that pdc doesn't get confused. Otherwise you can use Optimize animated GIF with the Coalesce (unoptimize) option to replace the delta/partial frames with full size frames.

Went to check for an existing bug for this, and found one that pointed to a discord post from a familiar face: Discord

LOL I didn't even remember that. I guess the lesson is don't use Photoshop to make GIFs (which may be a good thing since it was one of the last reasons I'm still paying for Photoshop).

If you have a build process that involves the command line you could process the gif to correct it.

To do it in-place on the same file:

gifsicle --batch --unoptimize anim.gif

You could also use magick but the only way I know how generates an extra, new gif.

2 Likes

linking this one here so I can double-check it once I get a fix for this problem: Some GIF images lead to wrong, unexpected results in converted .pdt image tables

1 Like