mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -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
616cd107df
commit
c77263f35b
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ module.exports = function (req, res, next) {
|
|||
}).then(() => {
|
||||
next();
|
||||
}).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();
|
||||
}
|
||||
next(err);
|
||||
|
|
Loading…
Add table
Reference in a new issue