Does anyone have any idea how to read or extract the thumbnail of a .skp file? Any hint where to start looking?
The SketchUp fileformat is not documented and things could change/break at any time.
But the SketchUp Sages site has instructions on how to extract the thumbnail:
It’s a .png file embedded in the .skp binary. .png files have a header “chunk” and a ending chunk you can use to extract the binary data between.
Thanks for the pointers, guys!
Maybe file a feature request for the APIs?
Is this what you need ?
The save_thumbnail method is used to generate a thumbnail for any SKP file
- not necessarily the loaded model.
Hint: If it is a Ruby solution you want, this thread should be in the Ruby API category.
… but the C API lacks an equivalent function.
Yes! Thank you
I don’t know how I missed that
You won’t in the future if you use the method search.
In the left nav pane click the “Methods” link at the top …
Then in the Search box, type the most descriptive part of a methodname, …
… like “thumb”, … and you’ll get a filtered list of all the methods that have that substring in their name.
Yes I know how to search. it’s just that in my brain this method was used to save a component or model thumbnail from the live model to disk. And that is indeed the case for ComponentDefinition.save_thumbnail or Model.save_thumbnail, but I never noticed Sketchup.save_thumbnail which is totally different.
Is there any plan to provide an equivalent C API function to write the thumbnail of a .skp file?
@xqtyler All we can do is file API Feature Requests as Thomas has done in the GitHub Issue tracker (see link below.)
Trimble already has the C-side code (as Ruby itself is implemented in C,) and there is a “ThumbsUp.DLL” with the Windows editions that allows the WIndows Explorer to display SKP and SKB thumbnail images. So it will take adding the existing code to the C API package and writing a function (or functions) to expose the functionality.
As a publicly traded company, Trimble employees are restricted when it comes to making public statements about future plans. Sometimes members of the Extensibility Team will announce a new function after implementation but before the release, if the next release is near the end of testing. But don’t count on it.
If you need this functionality, log on to GitHub, and add your vote () of support to the issue below, and add any comments you care to make to it’s thread.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.