PDA

View Full Version : Help debugging thumbnailer stl-thumb



treii28
June 25th, 2020, 06:07 PM
I recently installed 'stl-thumb' as a thumbnailer plugin to the file managers, but I notice that it isn't converting all files with the .stl extension. Upon closer inspection using the shell 'file --mime, the files that are "working" are binary encoded STL files but the ones that are not are ascii encoded STL files. Testing the script from the command line, however, shows that it works on both types of files.
Building a wrapper around the stl-thumb binary script archive so I can drop a log, I can see that it is not even attempting to do anything with the ascii encoded files. So I'm assuming it's something at the OS/file-manager level seeing those files as different.

The thumbnailer definition file is:

[Thumbnailer Entry]
TryExec=stlthumbnailer
Exec=stlthumbnailer -f png -s %s %i %o
MimeType=model/stl;model/x.stl-ascii;model/x.stl-binary;application/sla;


When I pull up properties for both types of files in the file-manager, the mime types listed for both show up as:


Unknown (model/x.stl-binary)


Checking from the command line with file however shows:

$ file --mime *.stl
binary_test.stl: application/octet-stream; charset=binary
ascii_test.stl: text/plain; charset=us-ascii

$ file -b --mime *.stl
application/octet-stream; charset=binary
text/plain; charset=us-ascii


Again, the thumbnailer script runs on teh binary encoded file, but doesn't appear to be run at all on the ascii encoded one. So I'm assuming it has either something to do with the mime types or the difference in content. Running the script manually on the ascii encoded file does work fine.
I'm not sure what to tweak to get it working properly.