Open vralle opened 2 years ago
@darylldoyle any thoughts on best approach here for an engineer to help with?
Here's what I remember. I could not find the need to generate metadata for the SVG. It is always a link to one file. We can generate an image tag of any size. Only the width and height attributes change. Sizes is available through filters. I may be wrong, but I've come to the conclusion that there is no need for persistent image size metadata. Instead, we can use a metadata filter that can return any size on request. The downside of this approach is that we won't be able to set dimensions for removed dimensions. This scenario is possible in case of using outdated sizes in templates/rest-client. Probably, in this case, you can generate a default size with the hope that this will not lead to a violation of the layout.
Here is what I did: https://gist.github.com/vralle/f45d68d758e2d26e54b99b71fa13f5e4
safe_svg->svg_dimensions
Describe the bug
The easiest way to remove thumbnail generation of a image size is to set the width and height to 0. This is an example of
wp_get_additional_image_sizes()
values:WordPress skips generation of such thumbnails. The plugin generates thumbnail metadata, where width and height can be 0.
This behavior results in unexpected behavior when using thumbnails. For example, structured data generation plugins can use zero-sizes for thumbnails.
This behavior is related #23
Steps to Reproduce
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct