Skip to content

Commit

Permalink
✨ Feature(custom): exclude svg from exif remove step
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Dec 27, 2023
1 parent 0e86c05 commit e62ea00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piclist",
"version": "1.6.8",
"version": "1.6.9",
"description": "Modified PicGo core, A tool for picture uploading",
"author": {
"name": "Kuingsmile",
Expand Down
13 changes: 6 additions & 7 deletions src/plugins/commander/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const i18n: IPlugin = {
cmd.program
.command('i18n')
.arguments('[lang]')
.description('change picgo language')
.description('change language, zh-CN, zh-TW, en')
.action(async (lang: string = '') => {
const list = ctx.i18n.getLanguageList()
if (!lang) {
Expand All @@ -20,15 +20,14 @@ const i18n: IPlugin = {
}
]
const answer = await ctx.cmd.inquirer.prompt<IStringKeyMap<string>>(prompts)
ctx.i18n.setLanguage(answer.i18n)
ctx.log.success(`Language set to ${answer.i18n}`)
return
lang = answer.i18n
}
if (!list.includes(lang)) {
ctx.log.warn('No such language'); return
ctx.log.warn('No such language')
} else {
ctx.i18n.setLanguage(lang)
ctx.log.success(`Language set to ${lang}`)
}
ctx.i18n.setLanguage(lang)
ctx.log.success(`Language set to ${lang}`)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ export const needCompress = (compressOptions: IBuildInCompressOptions | undefine

export const removeExif = async (img: Buffer, fileExt: string): Promise<Buffer> => {
fileExt = fileExt.toLowerCase().replace('.', '')
if (!imageFormatList.includes(fileExt)) {
if (!imageFormatList.includes(fileExt) || fileExt === 'svg') {
return img
}
return await sharp(img, {
Expand Down

0 comments on commit e62ea00

Please sign in to comment.