How to view gcode thumbnails on PC?  

  RSS
bobc
 bobc
(@bobc)
Reputable Member

I love the preview thumbnail you get on the Mini. I am wondering if there is any software to view the thumbnails on a PC?

I don't know if this is a standard feature of slic3r or something Prusa have added, but searching google and this forum didn't seem to give any relevant results. At least if I knew the format I could write my own viewer.

Any info appreciated.

Posted : 07/03/2020 11:00 am
Lichtjaeger
(@lichtjaeger)
Noble Member

The pictures are base64 encoded.

Open the gcode file with a text editor.

Copy the lines between "thumbnail begin ..." and "thumbnail end" and remove the "; " at the start of each line.

Then you can use a tool like this to render the picture.

Posted : 07/03/2020 11:15 am
bobc
 bobc
(@bobc)
Reputable Member

I think I will write a C# application to view them then.

Posted : 07/03/2020 11:43 am
With_maltodextrin
(@with_maltodextrin)
Trusted Member

@bobcousins

Pulling the image shouldn't be too bad - the image previews that PrusaSlicer embeds in the gcode files are base64 encoded .png files, like so:

;
; thumbnail begin 220x124 18444
; iVBORw0KGgoAAAANSUhEUgAAANwAAAB8CAYAAAACRt5vAAA10ElEQVR4Ae2dZ3RcxdnH9UISEhLOgQ
; MkBGyMG264SraK1aurJEvucpMty5bcjRumGGyKDcY0Y2NjMKYGHDDVYIMLJZDwQhpvck76t+QjOTn5
...snip...

I think the hardest part of writing the application will be to properly integrate with Explorer to present yourself as the thumbnail handler for .gcode files, guessing it'll be some COM garbage but have not personally tried.

Posted : 07/03/2020 10:32 pm
jkavalik
(@jkavalik)
Active Member

I am going to try today to make a shell extension to show the thumbnails.

Posted : 08/03/2020 9:20 am
bobc
 bobc
(@bobc)
Reputable Member

I wrote a standalone application, it was quite straightforward. It displays the thumbnail and some other bits of info like the print time. It can also generate the png as separate files, so Windows preview can display them.

It would be much neater with a shell extension, that's one of those things I would like to write but never figured out how. I can think of a few other file types I would like to get a preview for.

Posted : 08/03/2020 11:34 am
jkavalik
(@jkavalik)
Active Member

I made it work for me (Widnows 8.0 here) and put the code and binary release at https://github.com/jkavalik/GcodeThumbnailExtension

When registered it is used for *.gco and *.gcode files, checks the first 1000 lines to find a thumbnail and if it is present, then it gets the last of them (there can be multiple, my tests shoved two being generated, the first being 16x16px, probably for file-list preview) and returns it as the thumbnail image.

 

Currently there are no other info extracted but the SharpShell library I used to implement it allows another extensions modifying the tooltips, properties etc. so expected time, filament length and for example profile used might be added later.

Posted : 08/03/2020 12:48 pm
towlerg
(@towlerg)
Honorable Member

@bobcousins

Will you be posting the code?

Posted : 08/03/2020 1:08 pm
Chocki
(@chocki)
Prominent Member

Sorry, don't know what you wrote the app with, but AUTOIT allows the functionality you describe:

https://www.autoitscript.com/forum/topic/129955-_shellfile-create-an-entry-in-the-shell-contextmenu-when-selecting-an-assigned-filetype-includes-the-program-icon-as-well/

Maybe get some ideas or even see if your code can be ported to AUTOIT.

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet....
Posted : 08/03/2020 1:10 pm
towlerg
(@towlerg)
Honorable Member

Googling around I found this http://gcode.ws/ I don't normally like online apps but it seems to work.

Posted : 08/03/2020 1:30 pm
bobc
 bobc
(@bobc)
Reputable Member
Posted by: @towlerg

@bobcousins

Will you be posting the code?

Sure, I will put it on github.

Posted : 08/03/2020 1:53 pm
towlerg liked
alan.w8
(@alan-w8)
Active Member

I googled "gcode viewer" and found a simple on-line app that works very well.

Posted : 31/03/2020 6:30 pm
tomvogelsberg
(@prusatv)
Active Member

@jkavalik

I ran the install from your github link above, and after some of your assistance, I now have images for my gcode files ... which helps me find files much easier ...I really appreciate your efforts !!!

Thank You !!!
Stay Safe and Happy Printing !

This post was modified 6 months ago by tomvogelsberg
Posted : 26/05/2020 2:12 am
oltre81 liked
oltre81
(@oltre81)
New Member

sorry, i'm a poor italian, what i need for instal your preciuos dll on my windows7 system?

i try to search server registration manager but i didnt find :,(

Posted : 20/10/2020 1:35 am
jkavalik
(@jkavalik)
Active Member

@oltre81

Simplest should be downloading the 'v1.0.zip' from https://github.com/jkavalik/GcodeThumbnailExtension/releases/tag/v1.0

That contains all the necessary files.

Posted : 20/10/2020 7:03 am
towlerg
(@towlerg)
Honorable Member

Octoprint has a plugin to do this.

Posted : 20/10/2020 3:55 pm
--
 -2
(@-2)
Illustrious Member

Prusa Slicer 2.3.0 has a gcode viewer that rides along with the slicer. No more searching for some 3rd party app or website viewer.

This post was modified 1 month ago by --
It is always wise to get more than one opinion... as for trusting Prusa? No way man....
Posted : 20/10/2020 5:11 pm
oltre81
(@oltre81)
New Member

many thanks @javalik for your fast answer, great!

in late night yestrday i'm find that and try to install, but didn't work....i must work on it i think

@tim, i don't sure that preview run in windows explorer...

sorry to all for my italian english

Posted : 20/10/2020 10:16 pm
oltre81
(@oltre81)
New Member

@tim i mean don't generate thumbnails in explorer...

Posted : 20/10/2020 10:23 pm
--
 -2
(@-2)
Illustrious Member

If you install 3D Builder from teh Windows App store, it builds 3D previews in explorer. But the app must own the extension.

If you want to preview gcode files - examine how they build when printing - Prusa Slicer 2.3.0 has that capability (2.2.0 does not).

Here's both in play:

It is always wise to get more than one opinion... as for trusting Prusa? No way man....
Posted : 21/10/2020 3:14 am
Share:

Please Login or Register