修复保存的图片没有附加后缀

This commit is contained in:
silentdoer 2023-05-22 23:37:32 +08:00
parent 46d9cdce48
commit 4bb999e514

View File

@ -662,7 +662,7 @@ const createMainWindow = () => {
});
ipcMain.on('open-image', async(event, args) => {
var filename = `${imagesCacheDir}/img_${args.dataset.id}`;
var filename = `${imagesCacheDir}/img_${args.dataset.id}.jpg`;
fs.writeFileSync(filename, args.base64.replace(/^data:image\/png;base64,/, ''), 'base64');
shell.openItem(filename);