fix optimization file

This commit is contained in:
Marc-Roig 2022-08-04 17:16:43 +02:00
parent aa588b4629
commit 03c8ba6bba

View File

@ -130,11 +130,11 @@ module.exports = ({ strapi }) => ({
if (await isFaultyImage(currentFile)) {
throw new ApplicationError('File is not a valid image');
}
if (!(await isOptimizableImage(currentFile))) {
return currentFile;
if (await isOptimizableImage(currentFile)) {
return optimize(currentFile);
}
}
return optimize(currentFile);
return currentFile;
},
// TODO V5: remove enhanceFile