Thumbnail saving


#1

Saving (large) SketchUp files takes a long time (even with an SSD) if you have enabled ‘redefine thumbnail on save’ in - . In my current setup, this is always disabled (difference between instant saves or having to wait 20 seconds for a save).

‘Funny’ thing is: when running a Ruby script that uses model.save_thumbnail(filename), if that option is disabled, you get an empty thumbnail… so you have to manually enable it, run the script and disable it again.

It would be nice if the above could be fixed - instant saving even with thumbnails enabled would be the best of course.


#2

If the embedded thumbnail image is blank, I would expect this.

The model.save_thumbnail(filename) method is supposed to save whatever the internal thumbnail is (regardless of whether it is up to date or not.)

But if it will not save the embedded thumbnail when it is not blank, then that’d indeed be a bug.

I just tested on Win7x64 with SU2015x64 and all works as expected.
It saves the embedded thumbnail without regard to the checkbox setting. (In other words, it properly does not care whether the thumbnail image is blank or not, or represents the latest edits or is behind in it’s model representation.)

No bug in SketchUp 2015 on Windows.


To work around this, use view.save_image() with h x w at thumbnail sizes like 128 x 128 (or so.)


Also note, that I have a API Request in for a Model#update_thumbnail() [or Model#refresh_thumbnail(),] method.

Whatever they decide to name it. The latter name kind of follows the precedent with ComponentDefinition#refresh_thumbnail().


#3

Dan, as always your explanation is very clear. I will use the suggested code instead. Thanks a lot!


#4

Sorry, boobooed the method name. It is
view.write_image()


#5

I always use write_image for active_model and Sketchup.save_thumbnail with both args for unopened skps…

@DanRathbun, I understand that to be it’s main purpose?

john


#6

Well you do that because you need to use a 3rd-party thumbnailing utility on the Mac.

Vague question John.

What is that and it’s main purpose refer to ?

(There are too many possible objects between my statements and your question.)


#7

[quote=“DanRathbun, post:6, topic:15066”]
What is that and it’s main purpose refer to ?
[/quote]I am referring to the API definition having two args, regardless of the platform…

 status = Sketchup.save_thumbnail "skp_filename", "image_filename"

which retrieves the currently embedded image as a jpg from any saved skp… [ 256 x 256 px on a mac]

where as,

Sketchup.active_model.active_view.write_image "my_parrams"

will only work on the current view, regardless of the saved status of the skp…

I was therefore, agreeing with your advice to the OP, but asking if this was in line with your interpretation of the difference uses for the two methods…

john


#8

Oh okay, I guess I can agree that is what those methods are meant for.