5

Sometimes I download .avif images from the Internet. I would like the thumbnails of these images to appear in Files (nautilus). How do I enable thumbnails for AVIF images? Also, can I enable thumbnails for JXL images, HEIF images and HEIC images?

muru
  • 207,228
Flimm
  • 44,031

2 Answers2

6

The convert tool from imagemagick can be used to create thumbnails for AVIF images:

  • First, install imagemagick:
    sudo apt install imagemagick
    
  • Next, create a folder named thumbnailers in ~/.local/share.
    mkdir -p ~/.local/share/thumbnailers
    
  • Then, create a file named avif.thumbnailer in that folder.
    nano ~/.local/share/thumbnailers/avif.thumbnailer
    
  • Copy the following lines into the file (use Ctrl+C to copy, Ctrl+Shift+V to paste into nano window):
    [Thumbnailer Entry]
    Exec=/usr/bin/convert %i[0] -thumbnail %sx%s png:%o
    MimeType=image/avif;
    
  • Press Ctrl+O and Enter to save the file, and Ctrl+X to exit nano.
  • Finally, fully close the file manager (Nautilus in your case) with:
    nautilus -q
    

AVIF images should have their thumbnails the next time you open the file manager.

Notes:

  • I have only tested this on Ubuntu 22.04.3. On earlier releases, imagemagick might not support AVIF images, according to this thread.
  • Also on Ubuntu 22.04, imagemagick (v.6.9.11.60) does seem to support HEIC images:
    $ identify -list format | grep --ignore-case heic
         AVIF* HEIC      rw+   AV1 Image File Format (1.12.0)
         HEIC* HEIC      rw+   Apple High efficiency Image Format (1.12.0)
    
    However, I don't have any HEIC or HEIF images to test, so I can't be sure. You might want to trying putting the MIME types of those files into the avif.thumbnailer file and see if it works, for example:
    [Thumbnailer Entry]
    Exec=/usr/bin/convert %i[0] -thumbnail %sx%s png:%o
    MimeType=image/avif;image/heic;image/heic-sequence;image/heif;image/heif-sequence;
    
Calico Cat
  • 1,456
2

gThumb supports these image types since version 3.12. To install this program, run:

sudo apt install gthumb

It will install partial thumbnail support automatically. You might need to log out and log in again before this takes effect. Alternatively, you can try restarting the Files (nautilus) application by running:

nautilus --quit

It seems that the thumbnails are only created once Gthumb runs. So, to get the thumbnails to run, you need to open at least one of the images in the directory in Gthumb, and then it will create the thumbnails in the background.

Flimm
  • 44,031