Scanning directories and loading animated images too slow
See original GitHub issueDescription
First of all, great work. I’m really interested on it. Now, everything goes fine when you open a single file or several files using a glob expression (e.g. ~/Downloads/*.png
). However, whenever you want to browse a directory, it takes too long (like 20 secs or more) to load the TUI viewer (while recursively scanning image files in the given directory). Once the TUI finally loads, it is also a bit slow whenever you hover a directory (a few seconds depending on the directory).
To Reproduce
term-img DIR
or term-img DIR/*
Expected behavior
term-img
should be quicker and smoother when recursively browsing directories
Desktop:
- OS: Arch
- Kernel version: Linux 5.15.12 (libre-hardened)
Package info:
- Python version: 3.10.2
- Package version: 0.1.1
- Installation method: clone repo and then
pip install
Terminal Emulator:
- Name: Tested on Xterm (370) and Alacritty (0.10.0)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:23 (14 by maintainers)
Top Results From Across the Web
Fix Slow loading of folders green loading bar indefinitely in ...
Fix- 5 A lot of images inside the folder may be an issue ... Reduce the number of Pics inside the folder with...
Read more >Loading all images using imread from a given folder
Why not just try loading all the files in the folder? If OpenCV can't open it, ... if img is not None: images.append(img)...
Read more >How to fix QGIS being extremely slow? - GIS Stack Exchange
You can go to Settings -> User Profiles -> Open Active Profile Folder and do it for both your profiles and then can...
Read more >Android 11 very slow file access performance. : r/androiddev
It is over 6 times slower to load on Android 11 ... Which operations are slow - reads/writes, directory scan or metadata?
Read more >How To Optimize Images for Web and Performance - Kinsta
Images are often the #1 element responsible for slow page load times. ... Additional folders can be scanned to make sure every single...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! That would be great.
Hey @AnonymouX47! Sorry for the delay.
It’s much better now! Congrats and thanks! I really like this. I guess PIL internally uses something along the lines of cacalib or chafa (i.e., ASCII/ANSI rendering). Do you plan to add support for ueberzug, w3img, sixel or kitty? These protocols are really good at displaying images on the terminal, and besides they are more and more widely adopted.
I myself implemented a files previewer (not only images, but also PDF, document, postscript files, and even sound files) using fzf and ueberzug for my CliFM, but only as a plugin (a shell script indeed): it’s nice and all, but far from ideal. A third party utility able to do this smoothly, and able to be integrated into CliFM, would be really nice. And
term-img
is on the right track for sure.Keep up the good work!