mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[ImageCDN] Copy if failed to use ImageMagick
This commit is contained in:
parent
ae21d6d6cc
commit
f2ac90299c
1 changed files with 6 additions and 1 deletions
|
@ -31,7 +31,12 @@ export default (manifest) => {
|
|||
});
|
||||
|
||||
if (rawExt !== 'gif') {
|
||||
await new Promise((res) => exec(`convert "${rawFile}" -resize x720 -quality 90 "${finalFile}"`, res));
|
||||
try {
|
||||
await new Promise((res) => exec(`convert "${rawFile}" -resize x720 -quality 90 "${finalFile}"`, res));
|
||||
} catch (e) {
|
||||
console.error('Failed to use ImageMagick to resize and compress, copying file as backup');
|
||||
copyFileSync(rawFile, finalFile);
|
||||
}
|
||||
} else {
|
||||
copyFileSync(rawFile, finalFile);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue