Image Minify: Skip files without minifier & replace faulty message #1057
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request:
Summary
Fixes a faulty error message in case the image minifier processes all files,
and does not crash before, but some images can not be minified.
Also skip the minification process for all files which have no minifier set.
This allows to continue the task and not stop the minification process
for all files.
Description
In case of an error the message contains placeholders which
are not replaced anymore downstream
(
Minified {filecount} out of {filetotal} images into {destination}
).Print the result message as info and then return a short task message
without placeholders instead.
Early return for all files which have no minifier set,
to avoid fatal error with ambigous error message
“Minifier method cannot be found!”.
For example when webp images exist in the image directory.
The files are added to the error list right away,
to that the task may continue to minify other images and
show a result message (“Minified X of Y files”) at the end.