Sketchup SKP Thumbs

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

Post Reply
Jpalm
Posts: 10
Joined: Mon Jul 12, 2010 12:40 pm

Sketchup SKP Thumbs

Post by Jpalm »

Is there anyway to get MP to show SKP thumbs???
It used to. This is the reason I have it. XNview does but that doesn't show 3DS.
MP does not show ANY SKP, tried everything.
Would show some before update but new. Now since I tried rebuilding thumbs Noda!
User avatar
m.Th.
XnThusiast
Posts: 1676
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Sketchup SKP Thumbs

Post by m.Th. »

Here is the Python code to read the embedded thumbnail:

Code: Select all

#! /usr/bin/python
#
# Use this script as thumbnailer with Sketchup in Wine @ Linux:
# 1. Save the script in /usr/bin
#    (for example open the terminal and type: gksudo nautilus /usr/bin)
# 2. Register this thumbnailer in the Gnome configuration using these commands in the terminal:
# gconftool-2 -s /desktop/gnome/thumbnailers/application@x-wine-extension-skp/enable --type=bool true
# gconftool-2 -s /desktop/gnome/thumbnailers/application@x-wine-extension-skp/command --type=string "python /usr/bin/skp-thumbnailer.py %i %o"
#
#
import sys
import struct
import os
counter=0
def pngcopy(infile, outfile):
# copy header
    header = infile.read(8)
#    if header != "\211PNG\r\n\032\n":
#        raise IOError("not a valid PNG file")
    outfile.write(header)
    print header
# copy chunks, until IEND
    global counter
    while 1:
        chunk = infile.read(8)
        size, cid = struct.unpack("!l4s", chunk)
        print counter,chunk
        outfile.write(chunk)
        outfile.write(infile.read(size))
        outfile.write(infile.read(4)) # checksum
        counter+=1
        if cid == "IEND":
            break


infile = open(sys.argv[1], "rb")
infile.seek(0x76d)
outfile = open(sys.argv[2], "wb")
pngcopy(infile, outfile)
outfile.close()
# remove the thumbnail if it is empty (ie. because of not working png exporter in Sketchup in Wine)
if counter<=5:
    os.remove(sys.argv[2])
infile.close()
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
User avatar
xnview
Author of XnView
Posts: 46235
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Sketchup SKP Thumbs

Post by xnview »

I can't reproduce, SKP have thumbnails
Pierre.
Post Reply