Resize firefox symbol and prevent symbol with height > 70

This commit is contained in:
Julien Duponchelle 2015-10-09 12:05:48 +02:00
parent 9047578a8b
commit edbf1382eb
4 changed files with 451 additions and 2 deletions

View File

@ -3,5 +3,6 @@ python:
- '3.4'
install:
- pip install -rrequirements.txt
- apt-get install imagemagick
script:
- python check.py

View File

@ -19,6 +19,7 @@ import os
import jsonschema
import json
import sys
import subprocess
def check_schema(appliance):
with open('schemas/appliance.json') as f:
@ -45,6 +46,10 @@ def check_symbol(symbol):
if not os.path.exists(licence_file):
print("Missing licence {} for {}".format(licence_file, symbol))
sys.exit(1)
height = int(subprocess.check_output(['identify', '-format', '%h', os.path.join('symbols', symbol)], shell=False))
if height > 70:
print("Symbol height of {} is too big {} > 70".format(symbol, height))
sys.exit(1)
def main():

View File

@ -8,4 +8,25 @@ Rules
* All symbols must be provided as a SVG file
* A file named symbol.txt should exist and contain symbol licence
* Try top keep a small file size
* Try to keep a small file size
* Max height 70px unless you have a specific reason
Resize a svg
============
If the height of your SVG is too big. You can resize it with
a tools understanding SVG.
For imagemagick you need a version with rsvg (often it's OK on Linux).
For installating it on mac with Homebrew:
```
brew install imagemagick --with-librsvg
```
For resizing with a height of 70:
```
convert symbols/firefox.svg -resize x70 firefox.svg
```

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 32 KiB