I notice that my ~/.cache/thumbnails
folder is 3 GiB size because all the thumbnails are saved in .png
. How about compressing thumbnails using some efficient format like jpeg, avif, webp? I doubt that thumbnails is something we prefer to be lossless. Yet performance impact must also be taken in consideration, especially on older hardware with weak CPUs.
Disk space is cheap, ~/.cache can be removed at any moment or tweaked in a number of ways. We do lack a daemon to maintain its size low still.
pngs are lossless, cheap to encode and decode, so it saves on CPU usage and universally used. And contrary to the web, local disk storage is 100 times faster, so the file size does not matter as much.
And importantly this follows Thumbnail Managing Standard that allows those image files to be reused in different applications without having to generate new thumbnails each.
And before using a different format the specification would need to allow other formats.
jpeg* and webp are lossy so that can’t be used.
avif could maybe be used but its reach is not yet as universal, for instance it needs a third-party plugin for qt https://github.com/novomesk/qt-avif or gtk Displaying avif images with Gtk4 - #5 by SkiFire13 - help - The Rust Programming Language Forum it seems.