woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
1.04k stars 45 forks source link

Gifs piped into oculante do not animate #323

Open nonetrix opened 6 months ago

nonetrix commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. use -s to pipe a image into oculante e.g. for my use case weather radar with curl https://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmasiral_.gif | oculante -s but also curl https://media1.tenor.com/m/QyT87IjYTyMAAAAC/hatsune-miku-miku.gif | oculante -s for example works
  2. See that it doesn't animate
  3. Try downloading and opening it normally
  4. Animates

Expected behavior It animates like in imv

Screenshots / sample files migu wit da gun ;0 hatsune-miku-miku example vidya (embed fail)

Desktop (please complete the following information):

Additional context None I can think of

woelper commented 6 months ago

Thank you!

This is a known issue. After you pipe the image to Oculante, it is just data without any metadata. I just pass that to the image library to display it, which automatically determines the format. That means I can't do any of the fancy handling when I open the image normally and know the extension in advance. I could look at a better way to probe the piped image data beforehand.

woelper commented 6 months ago

This looks interesting for detecting the content: https://crates.io/crates/infer

nonetrix commented 6 months ago

What does Imv do? Could look at the source of that for inspiration perhaps