Trying to extract a .gblorb file with gblorb.ulx

Hi, as per the title. I’m trying to extract the assets of a gblorb file with gblorb.ulx.

This works, to an extent. Unfortunately it caps out at 1024 assets, and the particular file I’m working with has more than that, so I can only extract the first 1024 assets.

I’ve tried changing the constants in the .inf file, to increase the table size, to no success.

Is there an alternative option for extracting gblorbs or is there a technique I’m missing?

1 Like

If you’ve got access to a Ruby interpreter, I have a quick and dirty Blorb extractor I wrote in Ruby that I’m attaching here.

Pass a Blorb file to it, and it’ll extract to ./extracted/[blorb name]/. I’ve never tried it with a Blorb containing that many resources but there’s no reason it shouldn’t be able to handle it. I’ve used it on Unix only but there’s no particular reason it shouldn’t run on other operating systems, as long as they accept / as a path separator.

extract.zip (729 Bytes)

2 Likes

Cool! When I have a moment, I’ll see if it works. Thanks!

http://ifarchive.org/if-archive/programming/blorb/blorbtool.py has similar functionality, in Python.

It’s only set up to extract one resource at a time but you could script it.

1 Like

Worked perfectly. For your interest it had a little over 1500 resources.

1 Like

Ah, spoke a bit too soon. The jpg files appear to be corrupted, when they opened properly with gblorb.

Yes, your script works, though I was a bit dumb and confused ‘type’ for ‘use’ at first. As mentioned you can only extract one file at a time so it is somewhat unwieldy for my purposes. My coding experience is largely with domain specific languages (e.g. gaming) so running scripts to automate other scripts is something out of my comfort zone. Maybe that’s something worth learning.

Okay, I thought I’d be forced to learn bash but I realized I can just add a command to the python file.

    def cmd_pictexport(self,args):
        num = self.parse_int(args[0])
        for x in range(1,num):
            xtxt = '{}'.format(x)
            fname = '{}.jpeg'.format(x)
            try:
                self.cmd_export(['Pict',xtxt,fname])
            except:
                continue

A dirty hack that extracts all the jpeg in the blorb, which was exactly what I needed.

Looks good to me :)

1 Like

There’s also my Blorbtools package for making and extracting from Blorb files. See David Griffith / blorbtools · GitLab. It’s based on Graham’s original tools in Perl. I’ve kept it up-to-date to accommodate Inform6 and ZIL use. It runs primarily on Unix-ish systems.

(why is this Ruby script not called blo.rb :wink: )

2 Likes

i’m struggling to get pblorb to understand my grammar file (it seems like every blorb-ifier has a different format).

i’m trying something like this(ignoring name, copyright, etc):

storyfile my_story.ulx
picture 1 pic_1.jpg
picture 2 pic_2.jpg
cover cover_art.jpg

but i keep getting syntax errors.

EDIT:
never mind, i played around with quotation marks and figured it out.

1 Like

I’m glad you got it working. For future reference and others who might be looking for this information, this is the .blurb file I use in Uninvited:

storyfile "uninvited.z5" include
sound Bark		"sound/dogbark.aiff"
sound Cathedral		"sound/cathedral.aiff"
sound DoorClose		"sound/doorclose.aiff"
sound CellDoor		"sound/celldoor.aiff"
sound Explosion		"sound/explode.aiff"
sound Faucet 		"sound/faucet.aiff"
!sound Fire		"sound/fire.aiff"
sound Spray		"sound/spray.aiff"
sound Match1		"sound/match1.aiff"
sound Match2		"sound/match2.aiff"
sound MatchFumble	"sound/fumble.aiff"
sound Thunder1		"sound/thunder1.aiff"
sound Thunder2		"sound/thunder2.aiff"
sound Thunder3		"sound/thunder3.aiff"
sound ZombieAttack	"sound/zombiegroan.aiff"
sound ZombieRun		"sound/zombiehiss.aiff"
1 Like