Score:3

Enabling thumbnails for AVIF, JXL, HEIF, HEIC images

bd flag

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?

Score:2
dk flag

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;
    
Score:1
bd flag

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.

alter_igel avatar
us flag
I just tried installing gthumb 3.12 on Ubuntu and I'm not seeing any JXL image previews in gthumb or in nautilus after quitting and relaunching as suggested
bd flag
@alter_igel You're right. After fiddling with it, I think the thumbnails are only created once Gthumb has been launched in that directory. I've edited my answer to reflect this.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.