Commit 4b02063b authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix for #379: draw image file path doesn't work

parent ac235f2b
......@@ -3533,13 +3533,18 @@ function gui_drawimage_new(obj_tag, file_path, canvasdir, flags) {
}
file_path = path.normalize(file_path);
}
if (file_path !== "" &&
fs.existsSync(file_path) &&
fs.lstatSync(file_path).isDirectory()) {
files = fs.readdirSync(file_path)
if (file_path !== "" && fs.existsSync(file_path)) {
if (image_seq && fs.lstatSync(file_path).isDirectory()) {
// [draw sprite]
files = fs.readdirSync(file_path)
.sort(); // Note that js's "sort" method doesn't do the
// "right thing" for numbers. For that we'd need
// 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
files.forEach(function(file) {
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