-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regenerate command runs on non-image files #25
Comments
This makes sense to me, although we'd probably want to verify that it wasn't intentionally implemented this way. Also, PDF should be a part of the whitelist, because it has thumbnails as of 4.7. |
That makes sense, though many servers don't generate the image, so there might need to be a check. Another option would be to change the status message to something like
and
I'm not sure what the overall |
Yes, this latter suggestion seems more appropriate than changing the current behavior. |
Currently there seems to be 4 different paths to generate thumbnails:
As these might still change in the future, I wonder if it is not preferable to just rely on the WordPress functionality and simply mark all files as skipped that didn't produce a thumbnail. |
The skipping approach makes a lot of sense as long as there continues to be a real error when regenerating fails. |
Yes, that seems to be the main issue. I'm not sure there's a clean way to distinguish between these two cases if we only rely on WordPress functionality. |
Also a huge problem is that if script stumbles upon non-image file, it generates an error, effectively terminating process after batch completion. This makes multisite application of this command impossible, since there are lots non-image attachments on each blog (and I'm talking hundreds of blogs) I see that problem is in function |
Ran into this issue, single site install but with a composite bash script containing various wp cli commands, command exiting with error due to PDFs:
|
To address this issue, I'd like to see:
|
Could this be partially solved with a flag something like --extensions=jpeg,jpg,png,gif or --onlyimages=true etc. it could be used to include only media matching the wanted extensions? |
In alignment with "Decisions, not options", I'd prefer to improve the default behavior instead of adding more options. |
I was working on this over the weekend and have a PR which I'll push, as it's probably easier to discuss with code. It also addresses #43. |
When running this:
$ wp media regenerate --yes
The command runs on ALL attachments, regardless of file type.
This results in lots of awkward errors when run on audio, video, PDFs, etc. Here's an example:
In the above example, the media library contains 16 images and 7 non-image files.
It would seem
wp regenerate media
is naturally intended only for images and so it would make sense to only run it on a whitelist of filetypes. This would also avoid issues like this one.The text was updated successfully, but these errors were encountered: