eagle预览spine插件
This commit is contained in:
1 parent
3d72e88d88
commit
91815a355b
27 files changed
+70424
No files matched your search
@@ -0,0 +1,18 @@
|
||||
module.exports = async (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
var img = new Image();
|
||||
img.onload = function () {
|
||||
resolve({
|
||||
width: img.width,
|
||||
height: img.height,
|
||||
})
|
||||
};
|
||||
img.onerror = function (event) {
|
||||
resolve({
|
||||
width: 0,
|
||||
height: 0,
|
||||
})
|
||||
};
|
||||
img.src = require("url").pathToFileURL(filePath).href;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user