atanunq / viu

Terminal image viewer with native support for iTerm and Kitty
MIT License
2.57k stars 58 forks source link

Improperly dealing with massive files? #63

Open ergpopler opened 3 years ago

ergpopler commented 3 years ago
   > Preface

So i heard about viu and it immediately sparked my attention. The first thing that came to my mind is: "I can watch hentai from the terminal!" -- I attempted to do this. I downloaded some content and used ffmpeg to convert the mp4 to a gif. This results in a ~300mb file. Using MPV i was able to play the gif, but with viu it did nothing for a few seconds, my computer stuttered, then i proceeded to enter Ctrl+c -- this resulted in nothing, the program didn't close. A few seconds after this, my computer froze, froze to the point where even attempting to switch TTY's did nothing.

potential solution

if the issue is due to the large file size, viu should recognize this and stop itself, without crashing the system of which it is running.

ergpopler commented 3 years ago

a smaller, 2 minute gif works though, a 4-5 minute one does not

atanunq commented 3 years ago

Thanks for reporting this. Indeed, the file is loaded at the start and each frame is being resized. This is the case because for normal sized files we want to precompute everything and have control over the delay between frames.

I imagine it is possible to add a flag that changes this functionality and does it lazily.