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.