[ImageCDN] Copy if failed to use ImageMagick
This commit is contained in:
parent
ae21d6d6cc
commit
f2ac90299c
|
@ -31,7 +31,12 @@ export default (manifest) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (rawExt !== 'gif') {
|
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 {
|
} else {
|
||||||
copyFileSync(rawFile, finalFile);
|
copyFileSync(rawFile, finalFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue