!21 修复保存的图片没有加.jpg后缀

Merge pull request !21 from silentdoer/master
This commit is contained in:
Riceneeder 2023-05-23 01:02:47 +00:00 committed by Gitee
commit 01493bd37a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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);