Skip to content

Instantly share code, notes, and snippets.

@arawup
Last active October 22, 2023 05:52
Show Gist options
  • Save arawup/496045870d6364ed31f97cc407ea8a4c to your computer and use it in GitHub Desktop.
Save arawup/496045870d6364ed31f97cc407ea8a4c to your computer and use it in GitHub Desktop.
Krita Thumnailer doesn't support spaces in filename in Linux
[Thumbnailer Entry]
TryExec=unzip
Exec=sh -c 'unzip -p "%i" preview.png > "%o"'
MimeType=application/x-krita;

The krita thumbnailer normally used, found online or documented doesn't make previews for file names with a space

Ex: test file.kra(won't have a preview) testfile.kra(will have a preview)

Solution Update the thumbnailer and clear cahed failed thumbnails:

Why this solution, I believe the %i and %o variables aren't being passed properly when they have spaces

I tried it without them, cleared the thumbnails .cache and it doesn't work without the quotes around those

Verify that the sudo touch and tee are aimed at the correct location

# Creates and puts text in the Krita Thumbnailer
sudo touch /usr/share/thumbnailers/kra.thumbnailer
echo $'[Thumbnailer Entry]
TryExec=unzip
Exec=sh -c \'unzip -p "%i" preview.png > "%o"\'
MimeType=application/x-krita;' | sudo tee /usr/share/thumbnailers/kra.thumbnailer

Clear Thumbnailer cache Clear the cache for the bad thumbnails

Verify the path or do it manually

# the directory need to be emptied to ensure that new valid thumbnails are generated
#rm -rf $HOME/.cache/thumbnails/*

#SEO krita files missing thumbnailer/preview krita files with space missing thumbnailer/preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment