Jump to content

User:Ronhjones/SVGreduce

From Wikipedia, the free encyclopedia

Idiot's guide to reducing the default size of an image for non free SVG files.

option - add mw.loader.load('//commons.wikimedia.org/w/index.php?title=User:Rillke/SVGedit.js&action=raw&ctype=text/javascript'); to your common.js

  1. Use the guideline at WP:Image resolution to work out the new size - height is hhh, width is www
  2. Download the svg file (or select editsvg if option in use)
  3. Open with a text editor, and there is a decision
    1. There is a "viewBox" in the SVG - then add (or edit existing) height="hhh" width="www"[1]
    2. There is no "viewBox" in the SVG, just height="Value1" width="Value2" in the orginal SVG - then add viewBox="0 0 Value1 Value2", and edit the height="hhh" width="www" [1]
  4. Save
  5. if not using option, then upload as new version
  6. Edit and change {{non-free reduce}} to {{subst:orfurrev}}

Finished.

references

  1. ^ a b Kalliauer, Johannes (2018), How to reduce the preview-size of SVGs in Wikipedia {{citation}}: Check |author-link= value (help)