jcsalterego / pngpaste

Paste PNG into files, much like pbpaste does for text.
Other
455 stars 32 forks source link

gif animation #20

Open martin-braun opened 2 years ago

martin-braun commented 2 years ago

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.

jcsalterego commented 1 year ago

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

martin-braun commented 1 year ago

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.

jcsalterego commented 1 year ago

@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.