Neop.
Offline
| filename f data s version dict thumb |
filename := 'whatever'.
f := FileStream readOnlyFileNamedOrNil: filename.
data := f binary contentsOfEntireFile.
s := ReadStream on: data.
version := ObjStream scratchFileVersionFrom: (s next: 10) asString.
(version = 1) | (version = 2)
ifTrue: [
s skip: 4.
dict := ObjStream new readObjFrom: s showProgress: false.
thumb := dict at: 'thumbnail']
ifFalse: [thumb := nil].
"do something with thumb"
thumb display
Last edited by nXIII (2012-09-22 14:31:08)
Offline
I can do it in Python...
Offline
MathWizz wrote:
I can do it in JavaScript.
My code looks nicer.
import kurt kurt.ScratchProjectFile("project.sb").info["thumbnail"].save("thumbnail.png")
Last edited by blob8108 (2012-09-22 15:19:57)
Offline
jvvg wrote:
Does anybody know it in PHP? (i.e. to get it as a PNG or something?)
I don't think anyone's written a .sb parser in PHP. If your host supports Python, you could always execute a Python script using PHP's "exec".
Offline
I believe that JSO posted about this a while back, but I can't seem to find it. I'll keep looking.
Offline