Remove Inkscape dependency for ICO creation

Just use Imagemagick. Fixes #743.
This commit is contained in:
Oliver Hamlet
2017-01-06 09:36:58 +00:00
parent bee0aa7562
commit 5a1ccb159d
3 changed files with 10 additions and 10 deletions
-1
View File
@@ -23,7 +23,6 @@ addons:
- libasound2-dev
- libxtst-dev
# Scripting dependencies
- inkscape
- imagemagick
cache:
+1 -1
View File
@@ -25,7 +25,7 @@ environment:
secure: fBQJmUDK/EgEUWjjbo6bWcitczeFTJZT4OZ3ZZ4FoUT6soBsTWPQJnr8YEVMFhGP
install:
- choco install -y doxygen.portable InnoSetup inkscape imagemagick.tool
- choco install -y doxygen.portable InnoSetup imagemagick.tool
- python -m pip install sphinx breathe sphinx_rtd_theme
- npm install
- .\node_modules\.bin\bower install
+9 -8
View File
@@ -6,6 +6,9 @@ const svgPath = path.join('resources', 'icon.svg');
const buildDirectory = path.join('build', 'icon');
const outputPath = path.join(buildDirectory, 'icon.ico');
const svgSize = 192;
const svgDPI = 90;
const sizes = [16, 20, 24, 30, 32, 36, 40, 48, 60, 64, 72, 80, 96, 128, 256];
fs.mkdirsSync(buildDirectory);
@@ -15,15 +18,13 @@ sizes.forEach((size) => {
const pngFile = path.join(buildDirectory, `icon-${size}.png`);
convertArgs.push(pngFile);
helpers.safeExecFileSync('inkscape', [
'-z',
'-e',
pngFile,
'-w',
size,
'-h',
size,
helpers.safeExecFileSync('convert', [
'-density',
(size / svgSize) * svgDPI,
'-background',
'none',
svgPath,
pngFile,
]);
});