Thumbnail preview

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Thumbnail preview

Postby tripstar76 » Fri Jul 10, 2020 7:48 am

The thumbnail preview has never worked on my FC since v17, so I thought I'd make a thumbnailer....

Image

Python thumbnailer code that goes in /usr/local/bin folder....
https://pastebin.com/4MRmX3ts
chmod 755

Thumbnailer thigy, that goes in /usr/share/thumbnailers/ folder....
https://pastebin.com/HYHkpcHv

If anyone can improve on it, help yourself. Don't forget to tick these boxes....
Image

I'm using Linux Mint 20 XFCE. Python is version 3.8.2. Freecad Is 19 pre appimage

These are for the stl thumbnails. OpenSCAD needs to be installed for the stl's to work
https://pastebin.com/UEaTnwrB
https://pastebin.com/KpJzBxxc
Last edited by tripstar76 on Fri Jul 10, 2020 6:12 pm, edited 2 times in total.
User avatar
Kunda1
Posts: 9209
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thumbnail preview

Postby Kunda1 » Fri Jul 10, 2020 11:37 am

Does this work on MacOS as well ?
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Re: Thumbnail preview

Postby tripstar76 » Fri Jul 10, 2020 5:45 pm

Hmm, I don't know. It might need tweaking? I've never used a mac before.

I should add little bits to the original post!
TheMarkster
Posts: 2059
Joined: Thu Apr 05, 2018 1:53 am

Re: Thumbnail preview

Postby TheMarkster » Fri Jul 10, 2020 9:46 pm

Do you have the preference set to save the thumbnail into the document when saving files? Edit -> preferences -> general -> document -> Save thumbnail into project when saving document.
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Re: Thumbnail preview

Postby tripstar76 » Fri Jul 10, 2020 10:29 pm

I do, but like I said in the first post, it hasn't worked(for me) since FC17.
It was only the other day I thought about going through the old gits to find differences, and the difference is, from 18 onwards, there's no thumbnailer bits and bobs, that I could see. So, I pulled the stuff from FC17, tweaked, changed to python3 cos changes are afoot, and got it working.
pachiburke
Posts: 8
Joined: Tue Nov 24, 2020 9:46 am

Re: Thumbnail preview

Postby pachiburke » Tue Nov 24, 2020 9:54 am

I've just sent a pull request tackling this issue: https://github.com/FreeCAD/FreeCAD/pull/4078

The thumbnailer script (src/Tools/freecad-thumbnailer) needed some updates:
  • now it doesn't depend on gnome libs (it doesn't need to)
  • it works either with python2 and python3
  • a thumbnailer config file is added to the installation step (FreeCAD.thumbnailer in /usr/share/thumbnailers)
  • it no longer uses the .py extension
The freecad-thumbnailer script should be copied to /usr/bin/freecad-thumbnailer and should have execution rights

Code: Select all

$ sudo chmod +x freecad-thumbnailer
$ sudo cp freecad-thumbnailer /usr/bin/
$ sudo cp FreeCAD.thumbnailer /usr/share/thumbnailers/
fcaduser
Posts: 343
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Thumbnail preview

Postby fcaduser » Tue Nov 24, 2020 12:30 pm

drmacro
Posts: 2329
Joined: Sun Mar 02, 2014 4:35 pm

Re: Thumbnail preview

Postby drmacro » Tue Nov 24, 2020 12:50 pm

Just for complete understanding.

When you set Save thumbnail in preferences, the thumbnail is included in a folder in the FCStd zip file.

I thought it didn't work for the longest time because I don't use the Start workbench, where they are displayed nicely (at least in 0.19).

But, they are not displayed, in my case, by Thunar file manager.

Is this macro intended to allow these thumbnails to be seen in system file managers?

If so, what triggers the update of the database?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
User avatar
Kunda1
Posts: 9209
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thumbnail preview

Postby Kunda1 » Tue Nov 24, 2020 1:34 pm

Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features