mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Redirected to original image when resizing fails
refs https://github.com/TryGhost/Team/issues/1234 Sharp can occasionally fail resizing, this is usually due the the underlying libvips library failing. We do not want this to cause an error however, instead we should just show the original image - as resizing is an optimisation, rather than a requirement.
This commit is contained in:
parent
54b537deba
commit
0b973d1f29
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ module.exports = function (req, res, next) {
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
next();
|
next();
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
if (err.code === 'SHARP_INSTALLATION' || err.errorType === 'NoContentError') {
|
if (err.code === 'SHARP_INSTALLATION' || err.code === 'IMAGE_PROCESSING' || err.errorType === 'NoContentError') {
|
||||||
return redirectToOriginal();
|
return redirectToOriginal();
|
||||||
}
|
}
|
||||||
next(err);
|
next(err);
|
||||||
|
|
Loading…
Add table
Reference in a new issue