Azgaar / Fantasy-Map-Generator

Web application generating interactive and highly customizable maps

Home Page:https://azgaar.github.io/Fantasy-Map-Generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Total mind screw... When you export maps into SVGs with the "no pattern" ocean style, it increases the file size way bigger than all the other styles.

ngalerchalegocity60330 opened this issue · comments

Describe the bug

As someone looking for small file sizes I have been experimenting with ways to reduce the file sizes of the maps as much as possible. At one point when playing around with this program, I was able to get single digit kilobytes when exporting the maps into SVGs. And of course, small file sizes are useful for people with smaller hard drives or SSDs.

I have an extremely weird discovery which I don't know if you're aware of this. When I export maps into SVGs with the "no pattern" style for the ocean, the file size increases way bigger than if you selected the other ocean styles, which do have pictures.

file size comparison azgaar

The file at the bottom is bigger, but it has the "no pattern" ocean style, and the file at the top has the "pattern 1" style. Other styles give file sizes as small, as I've tested.

other map styles

When I opened the big SVG (the one that's 778 kb) with no pattern using the Windows's own notepad program, I found this extremely long string of what's supposed to be Base64 characters which I have no idea why those are there.

Notepad 1 real

This is what the end of the file looks like in notepad.
notepad 2 real

It's hard to see, but if you look on the bottom you would see "Ln 41, Col 767368" which just goes to show how big this is. Using an online character counter, there are over 760,000 characters from beginning to end.

character counter

I don't know if you are aware of this but I hope it gets fixed. Also I wonder if this has to do with something with the way the ".map" function works, but considering all the other map sizes are far smaller...

Also let me know if there are other known weird cases like this in the map generator and provide me with any workarounds you can.

Steps to reproduce

  1. Load a new map.
  2. Use the "pure landmass" style and. turn off the scale bar option.
  3. Then go to options and lower the "points number"
  4. Then set the style to "clean". 1K to ensure minimal file size. Do steps 2 to 4 to ensure minimal file size.
  5. Go to the "style" tab
  6. In the "select element" menu, select "ocean".
  7. In the pattern section, select "no pattern".
  8. Export the map into an SVG.
  9. Do the same thing, but this time, use any other pattern in the pattern section.
  10. Compare the file size: the one with "no pattern" will be bigger than the one with whatever other patterns are chosen.
commented

Cool, will fix it soon

commented

Please check now

Yep, works perfectly. I recently exported whole bunch of random maps (1k points, all elements turned off including the scale bar, and clean style) with the "no pattern" ocean style option and now I consistently get small file sizes instead of over 700 - 800 kilobytes. Thank you very much for fixing it. I'll report more bugs when I encounter them

Thank goodness