Contributing:Maintaining certain pages: Difference between revisions

From Space Station 14 Wiki
Aliser (talk | contribs)
Aliser (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
Changing the format and resizing can be done with an online tool or locally. Author recommends using {{C|libwebp}} — the official webp CLI utility, although that requires some console commands knowledge.
Changing the format and resizing can be done with an online tool or locally. Author recommends using {{C|libwebp}} — the official webp CLI utility, although that requires some console commands knowledge.


If using {{C|libwebp}}, to convert from another image format to webp and resize, use:<syntaxhighlight lang="bash">
If using {{C|libwebp}}, to convert from another image format to webp and resize, use (on Windows):<syntaxhighlight lang="bash">
cwebp map_image.png -o map_image.webp -resize 300 0 -q 100
cwebp.exe map_image.png -o map_image.webp -resize 300 0 -q 100
</syntaxhighlight>where {{C|map_image.png}} is the input filename, and {{C|map_image.webp}} is the output filename.
</syntaxhighlight>where {{C|map_image.png}} is the input filename, and {{C|map_image.webp}} is the output filename.
'''Powershell script to process all files in current directory'''
Note: this requires the libwebp to be in some other directory, eg a subdirectory.
{{Cut|<syntaxhighlight lang="powershell">
$files = Get-ChildItem .\*.* -Name -File
foreach($file in $files){
    $filename_without_ext = [io.path]::GetFileNameWithoutExtension($file)
    ./libwebp/webp.exe .\$file -o .\$filename_without_ext.webp -resize 300 0 -q 100
}
</syntaxhighlight>}}


=== Full size images ===
=== Full size images ===
There are 3 links at the start of each section:
There are 2 links at the start of each section:
# map.spacestation14.com - an interactive map.
# map.spacestation14.com - an interactive map.
# this wiki - for storing full scale map images here on the wiki.
# mapserver.spacestation14.com - the source for the full scale images. Should be up to date with new updates <ref>https://discord.com/channels/310555209753690112/771041304108072961/1111422441940586517</ref> once an issue <ref>https://discord.com/channels/310555209753690112/942862442688548884/1337749145032855614</ref> is resolved.
# mapserver.spacestation14.com - the source for the full scale images. Should be up to date with new updates <ref>https://discord.com/channels/310555209753690112/771041304108072961/1111422441940586517</ref> once an issue <ref>https://discord.com/channels/310555209753690112/942862442688548884/1337749145032855614</ref> is resolved.
 
Full scale images should not be hosted on the wiki due to performance concerns, instead the interactive map viewer is to be used.
==== Updating map image on wiki ====
For the wiki image, use a direct link to the image ''file'' instead of the file ''page''. File pages contain previous versions and can degrade performance significantly. To get a direct link, click the image file or the "original file" link.
 
To get a file ''page'' link from a direct image link, take the filename from the end of a link, for instance:<br>
{{c|Marathonstation.png}} from {{c|<nowiki>https://wiki.spacestation14.com/w/images/6/6f/Marathonstation.png</nowiki>}}<br>
and put it at the end of this link: <br>
{{c|<nowiki>https://wiki.spacestation14.com/wiki/File:</nowiki>}}
<references />


==== Working with Mapserver ====
==== Working with Mapserver ====
Line 51: Line 55:


Use your browser search to find {{C|gridId}} fields. Use links in {{C|url}} fields to see how a grid looks like. If a grid looks like a whole station, then it's a right grid.
Use your browser search to find {{C|gridId}} fields. Use links in {{C|url}} fields to see how a grid looks like. If a grid looks like a whole station, then it's a right grid.
Full API docs for Mapserver: https://www.postman.com/juliangiebel/ss14-mapserver/request/qgje53r/get-map-map-guid

Latest revision as of 15:01, 8 February 2025


Maps

Page: Maps

Thumb images

Map images are shown as thumbnail images (small images) to prevent slow load and performance issues.

Thumb images should be in webp format, 300px wide (the maximum allowed thumbnail size in user preferences). Height doesn't matter.

Changing the format and resizing can be done with an online tool or locally. Author recommends using libwebp — the official webp CLI utility, although that requires some console commands knowledge.

If using libwebp, to convert from another image format to webp and resize, use (on Windows):

cwebp.exe map_image.png -o map_image.webp -resize 300 0 -q 100

where map_image.png is the input filename, and map_image.webp is the output filename.

Powershell script to process all files in current directory Note: this requires the libwebp to be in some other directory, eg a subdirectory.

$files = Get-ChildItem .\*.* -Name -File

foreach($file in $files){
    $filename_without_ext = [io.path]::GetFileNameWithoutExtension($file)

    ./libwebp/webp.exe .\$file -o .\$filename_without_ext.webp -resize 300 0 -q 100
}

Full size images

There are 2 links at the start of each section:

  1. map.spacestation14.com - an interactive map.
  2. mapserver.spacestation14.com - the source for the full scale images. Should be up to date with new updates [1] once an issue [2] is resolved.

Full scale images should not be hosted on the wiki due to performance concerns, instead the interactive map viewer is to be used.

Working with Mapserver

Mapserver links look like this:

https://mapserver.spacestation14.com/api/Image/grid/box/master/1588

They usually don't change with existing maps, but it's not impossible. The mapper would have to delete the grid and place down a new one for it to change (the grid ID number at the end).

They are assembled with this format:

<mapserver url>/api/Image/grid/:mapId/:gitRef/:gridId
  • <mapserver url> is https://mapserver.spacestation14.com/
  • :mapId is a map ID, eg fland.
  • :gitRef is the name of a branch on ss14 repo, usually master
  • :gridId is a grid ID within the map. To see the grids for a particular map, go to https://mapserver.spacestation14.com/api/Map/:mapId/:gitRef

For Box (map), the link would look like: https://mapserver.spacestation14.com/api/Map/box/master

Grids would be ordered from biggest to smallest, so the first one is usually correct.

Use your browser search to find gridId fields. Use links in url fields to see how a grid looks like. If a grid looks like a whole station, then it's a right grid.

Full API docs for Mapserver: https://www.postman.com/juliangiebel/ss14-mapserver/request/qgje53r/get-map-map-guid