Overwriting post image attachment size
-
I know the editors of a blog can change the size of image attachments within a post (typically small, medium, large and full size) when they add media. However, it’s not always the case that all editors do this properly. This allows some posts to have images in full size (with resolutions in the thousands). Even though images are being scaled to fit the content through CSS, it’s not in any way an optimal solution. I want a fool-proof solution for this.
I’ve tried googling this for some time now, and I can’t seem to find a good solution. Ideally I’d prefer to filter all image attachments within a blog post and apply a custom image size to them (which I’ve prepared using “add_image_size”) with no cropping. The custom image width is fixed, but the height is dynamic. I doesn’t matter whether the images are in full size in the editor, I just don’t want the full size images to be loaded for the visitors.
This is not the featured image of a blog post, but the images/media within the single blog post.
Any ideas, or if there’s a filter I can apply to make this happen (or simply a plugin I can use) ?
Thanks in advance!
The topic ‘Overwriting post image attachment size’ is closed to new replies.