pngpaste icon indicating copy to clipboard operation
pngpaste copied to clipboard

gif animation

Open martin-braun opened this issue 3 years ago • 3 comments

pngpaste will only paste or base64 convert image data of the first frame of an animation.

It would be nice to output the entire file data, instead.

martin-braun avatar Nov 08 '21 22:11 martin-braun

@martin-braun (years later) do you have an example file?

jcsalterego avatar Feb 08 '23 18:02 jcsalterego

Alright, copy this GIF animation:

Now, in the terminal it would be nice to do this to get the entire GIF animation back:

FILE=pngpaste_gif_test.html
echo '<html><body><img src="data:image/gif;base64,' > $FILE
pngpaste -b >> $FILE
echo '" /></body></html>' >> $FILE

Now if you open the file in the browser it will only show the first frame, instead of the whole animation. Same goes to creating a file directly, i.e. pngpaste mygif.gif.

Essentially, I'm asking for GIF animation support. This would be a huge benefit for me.

martin-braun avatar Feb 08 '23 21:02 martin-braun

@martin-braun I have a lead on this issue. By default, pngpaste will use the output filename to determine the final format, but with -b it defaults to PNG format, not GIF. Working on a new parameter -t <type> or -f <format> so -b -f gif should work. We'll see soon.

jcsalterego avatar Feb 11 '23 16:02 jcsalterego