T53471: Fix crash with blender_icons_update.py
authorTroy Sobotka <troy.sobotka@gmail.com>
Wed, 13 Dec 2017 05:54:45 +0000 (16:54 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 13 Dec 2017 05:55:51 +0000 (16:55 +1100)
Default DPI of new inkscape caused incorrect image size.

release/datafiles/blender_icons_update.py

index ec753c567fa363d7982e5f1c8e62542fc97485ad..d342df0a6f9bafffad752b90d03013361c890559 100755 (executable)
@@ -10,16 +10,17 @@ def run(cmd):
 
 BASEDIR = os.path.abspath(os.path.dirname(__file__)) + os.sep
 
-inkscape_path = 'inkscape'
+inkscape_bin = "inkscape"
+blender_bin = "blender"
 
 if sys.platform == 'darwin':
     inkscape_app_path = '/Applications/Inkscape.app/Contents/Resources/script'
     if os.path.exists(inkscape_app_path):
-        inkscape_path = inkscape_app_path
+        inkscape_bin = inkscape_app_path
 
-cmd = inkscape_path + ' "%sblender_icons.svg" --export-dpi=90  --without-gui --export-png="%sblender_icons16.png"' % (BASEDIR, BASEDIR)
+cmd = inkscape_bin + ' "%sblender_icons.svg" --export-width=602 --export-height=640 --without-gui --export-png="%sblender_icons16.png"' % (BASEDIR, BASEDIR)
 run(cmd)
-cmd = inkscape_path + ' "%sblender_icons.svg" --export-dpi=180 --without-gui --export-png="%sblender_icons32.png"' % (BASEDIR, BASEDIR)
+cmd = inkscape_bin + ' "%sblender_icons.svg" --export-width=1204 --export-height=1280 --without-gui --export-png="%sblender_icons32.png"' % (BASEDIR, BASEDIR)
 run(cmd)
 
 
@@ -31,7 +32,7 @@ datatoc_icon_split_py = os.path.join(BASEDIR, "..", "..", "source", "blender", "
 
 # create .dat pixmaps (which are stored in git)
 cmd = (
-    "blender "
+    blender_bin + " "
     "--background -noaudio "
     "--python " + datatoc_icon_split_py + " -- "
     "--image=" + BASEDIR + "blender_icons16.png "
@@ -46,7 +47,7 @@ cmd = (
 run(cmd)
 
 cmd = (
-    "blender "
+    blender_bin + " "
     "--background -noaudio "
     "--python " + datatoc_icon_split_py + " -- "
     "--image=" + BASEDIR + "blender_icons32.png "