Guard against null bytes, use combine for svg.n path

This commit is contained in:
Joshua Granick
2015-05-05 18:24:17 -07:00
parent 46094c1dc4
commit 8bab88bcd7
2 changed files with 11 additions and 4 deletions

View File

@@ -199,17 +199,24 @@ class IconHelper {
if (image != null) {
var data = null;
if (size < 256) {
imageData.push (BMP.encode (image, ICO));
data = BMP.encode (image, ICO);
} else {
imageData.push (image.encode ("png"));
data = image.encode ("png");
}
images.push (image);
if (data != null) {
imageData.push (data);
images.push (image);
}
}

View File

@@ -23,7 +23,7 @@ class ImageHelper {
// try using Lime "legacy" to rasterize SVG first, since it is much faster
ProcessHelper.runCommand ("", "neko", [ PathHelper.getHaxelib (new Haxelib ("lime")) + "/svg.n", "process", path, Std.string (width), Std.string (height), temp ], true, true);
ProcessHelper.runCommand ("", "neko", [ PathHelper.combine (PathHelper.getHaxelib (new Haxelib ("lime")), "svg.n"), "process", path, Std.string (width), Std.string (height), temp ], true, true);
if (FileSystem.exists (temp)) {