优化识别
This commit is contained in:
1 parent
7263a841cb
commit
5cb2e76471
9 files changed
+302
-66
No files matched your search
@@ -0,0 +1,14 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const badgePath = path.join(__dirname, '..', 'assets', 'spine-badge.png');
|
||||
let cachedDataUrl = null;
|
||||
|
||||
function dataUrl() {
|
||||
if (!cachedDataUrl) {
|
||||
cachedDataUrl = 'data:image/png;base64,' + fs.readFileSync(badgePath).toString('base64');
|
||||
}
|
||||
return cachedDataUrl;
|
||||
}
|
||||
|
||||
module.exports = { path: badgePath, dataUrl };
|
||||
Reference in new issue
Block a user