-
Notifications
You must be signed in to change notification settings - Fork 107
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
Store file size (and other) media metadata #8
Comments
Worth noting that there's often a read cost ($) associated with these types of remote lookups, depending on where/how the images are hosted. |
I updated the trac ticket with a refresh against trunk. From the last comment from Andrew Ozz:
Leaving off the "backfill" for existing images could also be left for a second phase, it could probably happen naturally as a part of image regeneration. |
For every single image size a new mime type would be created if the original mime type of the image supports the specified mime type. Currently this only works with: `image/jpg` and `image/webp` and vice-versa. Only for all the available image sizes except the full size image. This PR fixes: #142, #8
@mitogh @felixarntz can this issue also be closed as my understanding was that #147 also covered this issue? Please could you confirm? |
That's correct @eclarke1 I wonder if we should create a new one to move the efforts from emerging the original PR into core at some point or if we should do it once the whole feature is merged there. |
Good question, this is something we may need to defer to @felixarntz on as there are a few other issues in a similar position I believe. |
At the moment, WordPress does not store the file (storage) sizes for uploaded files, or the sizes of media generated, in the database. At the moment, whenever WordPress needs to find out this information, it needs to read from the filesystem, or make remote requests in the case of a CDN. This keeps WordPress from using this information to make more informed decisions about responsive images or resizing in a performant fashion.
We should store file sizes as attachments are uploaded, and use this information in appropriate existing locations in core where file size is queried.
Trac ticket: https://core.trac.wordpress.org/ticket/49412
The text was updated successfully, but these errors were encountered: