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!
Post Reply
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Thumbnail preview

Post by tripstar76 »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thumbnail preview

Post by Kunda1 »

Does this work on MacOS as well ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Re: Thumbnail preview

Post by tripstar76 »

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
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Thumbnail preview

Post by TheMarkster »

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.
tripstar76
Posts: 10
Joined: Tue Sep 27, 2016 9:32 pm

Re: Thumbnail preview

Post by tripstar76 »

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: 11
Joined: Tue Nov 24, 2020 9:46 am

Re: Thumbnail preview

Post by pachiburke »

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: 448
Joined: Wed Feb 19, 2014 6:53 pm
Location: Near Paris, France

Re: Thumbnail preview

Post by fcaduser »

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

Re: Thumbnail preview

Post by drmacro »

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."
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Thumbnail preview

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply