Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rishabh Gupta
purr-data
Commits
77536614
Commit
77536614
authored
Oct 22, 2017
by
Jonathan Wilkes
Browse files
Merge branch 'drawimage-fix'
parents
f87b33a0
4b02063b
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
77536614
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment