-
Notifications
You must be signed in to change notification settings - Fork 3k
Multi-mime support, use WebP for content when smaller #2393
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
Multi-mime support, use WebP for content when smaller #2393
Conversation
…_wp_get_sources_from_meta
…pes. * Revert to 0 (first element) as default mime type ofr sub sizes
2fc4fe7
to
f863431
Compare
a0bed59
to
0d38d2e
Compare
2b8acf3
to
775f4ff
Compare
2e6bd30
to
503a299
Compare
…ss-develop-fork into add/webp-uploads
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
I see we do have |
regarding reading EXIF data, I found another instance we we have a filterable list of types which support reading EXIF data; I wonder if we should use the same list (plus WebP) here, looks like tiff image which we support also include EXIF data: wordpress-develop/src/wp-admin/includes/image.php Lines 833 to 843 in 57f4d6c
|
@felixarntz in 253e908 I tried switching from |
@adamsilverstein Pushed one tiny code fix in ab79356. |
* @param string $dest_path | ||
* @param string $extension | ||
* @return string filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamsilverstein Nitpick, but since we've now added documentation for $suffix
, it may be good to document the other parameters and the return value as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented in feaea78
(#2393)
Addressing final feedback and looking into failing test, the output_mime_type change is breaking the |
…ss-develop-fork into add/webp-uploads
Fix for the final test issue in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! From my perspective this is basically good to commit now 🎉
src/wp-admin/includes/image.php
Outdated
// Check if any of the new sizes already exist. | ||
if ( isset( $image_meta['sizes'] ) && is_array( $image_meta['sizes'] ) ) { | ||
foreach ( $image_meta['sizes'] as $size_name => $size_meta ) { | ||
if ( isset( $sizes ) && is_array( $sizes ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something here, but thought I'd check in.
It looks like this is checking $sizes
, which is set to array()
just above and can only be empty.
Why is $image_meta['sizes']
no longer checked?
I haven't made it through the rest of the PR yet, so it's possible I'm missing context.
If this is no longer needed due to other flow changes, would it make sense to change things, since the variable is set to array()
just above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! this was a bug probably from a late refactor that would only affect retries (when _wp_make_subsizes
is used). I restored the previous behavior now - the only difference from trunk now is adding the mime type checks so each mime type can be checked.
Fixed in f1db696
(#2393)
I verified retries work by setting my PHP timeout very low and uploading a large image.
Trac ticket: https://core.trac.wordpress.org/ticket/55443
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.