Commit 77536614 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'drawimage-fix'

parents f87b33a0 4b02063b
...@@ -3533,13 +3533,18 @@ function gui_drawimage_new(obj_tag, file_path, canvasdir, flags) { ...@@ -3533,13 +3533,18 @@ function gui_drawimage_new(obj_tag, file_path, canvasdir, flags) {
} }
file_path = path.normalize(file_path); file_path = path.normalize(file_path);
} }
if (file_path !== "" && if (file_path !== "" && fs.existsSync(file_path)) {
fs.existsSync(file_path) && if (image_seq && fs.lstatSync(file_path).isDirectory()) {
fs.lstatSync(file_path).isDirectory()) { // [draw sprite]
files = fs.readdirSync(file_path) files = fs.readdirSync(file_path)
.sort(); // Note that js's "sort" method doesn't do the .sort(); // Note that js's "sort" method doesn't do the
// "right thing" for numbers. For that we'd need // "right thing" for numbers. For that we'd need
// to provide our own sorting function // to provide our own sorting function
} else {
// [draw image]
files = [path.basename(file_path)];
file_path = path.dirname(file_path);
}
// todo: warn about image sequence with > 999 // todo: warn about image sequence with > 999
files.forEach(function(file) { files.forEach(function(file) {
ext = path.extname(file).toLowerCase(); ext = path.extname(file).toLowerCase();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment