2019-10-21 Metainformation for an image

Recently, @jalanhenning asked me whether it was possible to get from a dungeon map in Hex Describe to an editable map in Gridmapper. There wasn’t, but I liked the idea and so I started thinking about it. It should be doable in theory even though I am generating the dungeon maps using Text Mapper and all they have in common with *Gridmapper* maps is that they look similar.

@jalanhenning

Hex Describe

Gridmapper

Text Mapper

So yesterday I started writing the code that transforms the *Text Mapper* data into a *Gridmapper* link. Once I could see it in the log output, I was happy. But what next?

I decided to add a HTTP header with that link, hoping that *Hex Describe* would be able to extract it, and I told J. Alan Henning that I had these instructions for him:

1. generate map using *Hex Describe*

2. use *View Image* to look at a dungeon map

3. use *Inspect Element* to get to the development tools

4. switch to the *Network* tab

5. click the *Reload* button

6. click on the new request line to see details

7. in the *Headers* tab, there’s a section called *Response headers*

8. in that list there’s a header called *X-Link*

9. the value of that header is the Gridmapper link

It was late, I was tired, and I needed to sleep, obviously. 🙂

As the rendered image uses the SVG format, I alread had the input used in a comment at the end. Therefore, the link I just mentioned can be found right there. The *X-Link* code I had written was unnecessary and I removed it.

The instructions were in fact much simpler!

1. generate map using *Hex Describe*

2. use *View Image* to look at a dungeon map

3. use *View Page Source* to look at the SVG code

4. scroll to the end until you see the *Gridmapper* link

But then I realized that I could simply add the information the SVG output as a link! Within *Hex Describe* it’s hard to spot the link. It’s tiny:

Hex Describe output with link

If you use *View Image*, however, it gets bigger:

View Image

View Image

(If you click the image above, you might get taken to a different image because the seed I used is only guaranteed to work for as long as the code doesn’t change. My guess is that this won’t be stable for long!)

If you click the link in the top left corner, you’re taken to *Gridmapper*:

Image 3

Image 3

​#Programming ​#Web ​#SVG ​#Hex Describe ​#Text Mapper ​#Gridmapper

Comments

(Please contact me if you want to remove your comment.)

I was playing with Gridmapper the other day and was wondering about Switch Background and Toggle Floor commands. I couldn’t figure them out. Any hints?

– Ruprecht 2019-10-30 19:02 UTC

---

The *Switch Background* command (capital Z) toggles between various background options:

The *Toggle Floor* command (hold Alt and use the arrow keys to move around) simply toggles the floor on or off. In other words, it’s the equivalent of pressing f and and arrow key repeatedly – it’s simply faster.

– Alex Schroeder 2019-10-30 22:46 UTC