RAF and XCF thumbnails in Ubuntu 20.04

Hello together,

Since I upgraded to Ubuntu 20.04, I cannot generate thumbnails any more for my Fujifilm RAF files and Gimp files created by Gimp 2.10 or newer.

ufraw and gnome-raw-thumbnailer have been removed from the repositories and now I rely on gdk-pixbuf-thumbnailer for RAW file thumbnail generation, but it apparently doesn’t recognize RAF files:

$ gdk-pixbuf-thumbnailer -s 512 photo.raf thumbnail.png

** (gdk-pixbuf-thumbnailer:4097): WARNING **: 22:32:25.888: Could not thumbnail 'photo.raf': Couldn?t recognize the image file format for file ?photo.raf?

For Nikon NEF files it works without problems.

To generate XCF thumbnails I use xcf2png, but XCF versions higher than 10 aren’t supported any more:

$ xcf2png image.xcf -o thumbnail.png
Warning: XCF version 12 not supported (trying anyway...)

Can anyone successfully generate thumbnails for Fujifilm RAF and/or Gimp 2.10 XCF files on their Ubuntu 20.04?

Thanks a lot for any help,
Christoph

maybe it is fixed in 20.10?

I’m running Ubuntu Studio 20.04. Both RAF and XCF thumbnails work for me. Check to see if tumbler and tumbler-plugins-extra are installed. Good luck!

Hello St. Stephen,

Thanks a lot for your response!

Yes, tumblerd is running with tumbler-plugins-extra installed. I can also see that tumblerd calls the thumbnailer, but gdk-pixbuf-thumbnailer/xcf2png fail to generate the thumbnails for RAF and XCF files.

May I ask if you use Gimp from the repositories or from snap/flatpak? Whenever you save a XCF file, Gimp automatically generates the thumbnail. In case Gimp is intalled via apt, the thumbnail is stored in ~/.cache/thumbnails from where the file browsers can access it. In case Gimp is installed from snap/flatpak, it stores its thumbnails in a different cache, which is not accessible for the file browsers.

Concerning the RAF thumbnails, do you use a tool like Rapid Photo Downloader? Some downloaders generate system thumbnails upon file download so tumblerd doesn’t have to do it.

Anyway, I would really appreciate if you could send me the files in /usr/share/thumbnailers from your system so I can compare them with mine.

Thanks a lot in advance,
Christoph

@christoph I’m using Gimp 2.10.23 from appimage. There are probably newer versions by now. It’s been months since I installed that one.
Ubuntu Studio has Rapid Photo Downloader installed but I’ve never used it.
The /usr/share/thumbnailers folder has 7 files in there. Here goes it.

atril.thumbnailer
[Thumbnailer Entry]
TryExec=atril-thumbnailer
Exec=atril-thumbnailer -s %s %u %o
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-dvi;application/x-bzdvi;application/x-gzdvi;image/vnd.djvu;image/vnd.djvu+multipage;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/vnd.comicbook+zip;application/vnd-comicbook.rar;image/*;application/oxps;application/vnd.ms-xpsdocument;

blender.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/share/blender/scripts/blender-thumbnailer.py
Exec=/usr/share/blender/scripts/blender-thumbnailer.py %i %o
MimeType=application/x-blender;

evince.thumbnailer
[Thumbnailer Entry]
TryExec=evince-thumbnailer
Exec=evince-thumbnailer -s %s %u %o
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/x-ext-pdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-ext-ps;application/x-ext-eps;application/illustrator;application/x-dvi;application/x-bzdvi;application/x-gzdvi;application/x-ext-dvi;image/vnd.djvu+multipage;application/x-ext-djv;application/x-ext-djvu;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/x-ext-cbr;application/x-ext-cbz;application/x-ext-cb7;application/x-ext-cbt;application/vnd.comicbook+zip;application/vnd.comicbook-rar;application/oxps;application/vnd.ms-xpsdocument

ffmpegthumbnailer.thumbnailer
[Thumbnailer Entry]
TryExec=ffmpegthumbnailer
Exec=ffmpegthumbnailer -i %i -o %o -s %s -f
MimeType=video/jpeg;video/mp4;video/mpeg;video/quicktime;video/x-ms-asf;video/x-ms-wm;video/x-ms-wmv;video/x-msvideo;video/x-flv;video/x-matroska;video/webm;video/mp2t;

gdk-pixbuf-thumbnailer.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/png;image/bmp;image/x-bmp;image/x-MS-bmp;image/gif;image/x-icon;image/x-ico;image/x-win-bitmap;image/vnd.microsoft.icon;application/ico;image/ico;image/icon;text/ico;application/x-navi-animation;image/jpeg;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/tiff;image/x-xpixmap;image/x-xbitmap;image/x-tga;image/x-icns;image/x-quicktime;image/qtif;

librsvg.thumbnailer
[Thumbnailer Entry]
TryExec=/usr/bin/gdk-pixbuf-thumbnailer
Exec=/usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
MimeType=image/svg+xml;image/svg+xml-compressed;

mypaint-ora.thumbnailer
[Thumbnailer Entry]
TryExec=mypaint-ora-thumbnailer
Exec=mypaint-ora-thumbnailer %i %o %s
MimeType=image/openraster

Hope this helps.

Hello St. Stephen,

Thanks a lot for your reply. I don’t know if AppImages are also confined or if Gimp can store its thumbnails in the normal folder for the file manager to find them there. Whatsoever, I “solved” my problem by using exclusively Gimp’s flatpak cache for all thumbnails:

$ ln -s ~/.var/app/org.gimp.GIMP/cache/thumbnails/ ~/.cache/thumbnails

What puzzles me more is from where you get your RAF thumbnails. In the thumbnailers you posted above there is not even the RAF file format registered as MIME type (image/x-fuji-raf;image/x-raf;). Tumbler shouldn’t even attempt to create thumbnails for RAF files.

Anyway, I set down in the last hours and implemented my own thumbnailer for RAF files. In case anyone is interested:

First create the following bash script in /usr/local/bin/raf-thumbnailer (or any other folder of your liking):

#!/bin/bash

# Thumbnailer for Fujifilm RAF files

# This script depends on the following packages:
# - gridsite-clients for urlencode
# - exiv2 for exiv2
# - imagemagick for convert

# Check for correct number of command-line arguments
if [ $# -eq 3 ]
then

  # First argument is path to RAW file (convert from URI to normal path)
  RAW=$(urlencode -d "$1")

  # Second argument is output path for thumbnail file
  OUT="$2"

  # Third argument is image size
  SIZE="$3"

  # Remove directory from path
  NAME="${RAW##*/}"

  # Remove extension from file name
  BASE="${NAME%.*}"

  # Compose path to thumbnail as composed by exiv2
  PREV="/tmp/${BASE}-preview2.jpg"

  # Change into directory for temporary files:
  # exiv2 should store the preview image there when given the argument
  # "-l /tmp", but it always stores it in the current working directory.
  cd "/tmp"

  # Extract preview image from RAW file
  exiv2 -ep2 -f "${RAW}"
  
  # Convert preview image into thumbnail
  convert -auto-orient -scale "${SIZE}x${SIZE}" "${PREV}" "${OUT}"

  # Delete preview image
  rm -f "${PREV}"
fi

Then register this script as thumbnailer for RAF files by creating file /usr/share/thumbnailers/raf.thumbnailer:

[Thumbnailer Entry]
TryExec=/usr/local/bin/raf-thumbnailer
Exec=/usr/local/bin/raf-thumbnailer %u %o %s
MimeType=image/x-fuji-raf;image/x-raf;
2 Likes

OMG you are amazing I can’t believe that in Ubuntu 23.10 and Debian 12 with Gnome there still isn’t any RAW thumbnailer support and all online articles do not help using packages that can no longer be installed!

Your thumnailer works great for RAW RAF, DNG files, however x-sony-arw for some reason doesn’t show.

I am getting an error when opening it Image Magick directly:

Unknown field with tag 50341 (0xc4a5) encountered. 'TIFFReadDirectory'@ warning/tiff.c/TIFFWArnings/985:

Sorry, I don’t have a Sony camera. I’m afraid, I cannot help you with this.