Getting Thumbnails for DXF (CAD) Drawings working under LXDE Desktop on Fedora 20

Written by James McDonald

July 14, 2014

I use QCAD Professonal and love it, but in PCManFM which is the default filemanager for LXDE you just get a standard ugly icon for dxf drawings. I like the thumbnails to be a preview of the content of the file.

So I downloaded dxf-thumbnailer from here ==> http://yorik.uncreated.net/guestblog.php?2010=5

However it wouldn’t run on Fedora 20 because it wouldn’t import Image or ImageDraw. At first I thought it was because I didn’t have the Python PIL (Python Image Library) installed but I discovered that PIL has been replace with python-pillow which was installed.  So I had to make the following changes (add “from PIL import” … lines) and then it worked

diff  /home/jm/Downloads/QCAD/dxf-thumbnailer.py /usr/local/bin/dxf-thumbnailer.py 
42c42,44
< import sys, getopt, gnomevfs, Image, ImageDraw
---
> import sys, getopt, gnomevfs
> from PIL import Image
> from PIL import ImageDraw

Then I found I needed to create /usr/share/thumbnailers/dxf-thumbnailer.thumbnailer with the following content. (the one listed on the http://yorik.uncreated.net/guestblog.php?2010=5 page was very old)

[Thumbnailer Entry]
TryExec=dxf-thumbnailer.py
Exec=dxf-thumbnailer.py %u %o %s
MimeType=image/x-dxf;image/vnd.dxf;image/vnd.dwg;image/x-dwg;application/dxf;

 

Once the dxf-thumbnailer.thumbnailer file is installed  to /usr/share/thumbnailers and you have dxf-thumbnailer.py in your path (I put it in /usr/local/bin) and have made it executeable ( run “chmod +x /usr/local/bin/dxf-thumbnailer.py” as root ). You just need to logout and back on to start it working and then you get nice 128 pixel thumbnails as shown here:

dxf-thumbnailer-sample

I’m not sure it matters but I also installed tumbler which describes itself as a “D-Bus service for applications to request thumbnails” and tumbler-extras   which includes  “Additional thumbnailers” which may or may not have helped.

yum install tumbler-extras tumbler

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

How to Research a CPU Upgrade

How to Research a CPU Upgrade

Upgrade Time! Doing a lot of VMWare Workstation virtualization to create labs for self-study and training. Finding...