jlu5/icoextract

exe-thumbnailer.thumbnailer keeps failing to generate thumbnails

Closed this issue · 3 comments

I'm on Fedora 36, and I've placed exe-thumbnailer.thumbnailer into /usr/local/share/thumbnailers/, but it keeps failing to generate icons for my EXE files. They always end up as a 1x1 PNG image in the fail directory.
icoextract and icolist themselves work just fine and output correct PNG images.

Any idea what's wrong?

UPDATE: Turns out you have to install it as root or use a virtual environment.

jlu5 commented

Hi,

Installing as root shouldn't be strictly required; what's needed is access to the dependencies (pefile and pillow). These are fairly common and you should find them in most distro repositories.

Also, you should see a more obvious error if you try running exe-thumbnailer from the command line:

usage: exe-thumbnailer [-h] [-V] [-s SIZE] [-v] inputfile [outfile]

Linux (freedesktop.org) thumbnailer for Windows PE files (.exe/.dll)

positional arguments:
  inputfile             input file name
  outfile               output file name

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -s SIZE, --size SIZE  size of desired thumbnail
  -v, --verbose         enables debug logging

Pefile and Pillow are both installed, and exe-thumbnailer does not spit out any error, and works when I manually run it from the terminal.
It's just when Nautilus/GNOME tries to run it for thumbnail generation that it "bugs out" and generates that 1x1 pixel PNG.
I'm guessing since the thumbnailer is located at /usr/local/share/thumbnailers/ (root) it also tries to look for icoextract and icolist at root, which does not exist.
So perhaps placing the thumbnailer locally at ~/.local/share/thumbnailers/ might work?
But running sudo pip3 install icoextract[thumbnailer] installs icoextract and icolist at root, so for now that's what I'm sticking with.
Next time I setup a VM I'll explore this further.

jlu5 commented

Yes, ~/.local/share/thumbnailers/ will be better if you're installing locally (per user). I'll make the description more clear