Is there a way to resize images to the actual size they will be shown in the post? I have users that import a large image and then resize it in the visual editor. This is easy, since they can just drag the image until it is the size they want, without first opening an image editor, resizing the image, saving it, and uploading it as a separate attachment. Of course, this sometimes results in an image that is 100px wide in the post, but 1500px in reality.
Is there a plugin that does this when a new post is saved? I would like to keep the existing full-size image (for linking, or later resizes), but just add an extra size (and save it in the _wp_attachment_metadata
object), so this post has the image in the correct size, and a reference to the full-size attachment.
Of course, all existing posts should also be handled once. <img>
tags there might have just a width
, just a height
, or none of them: this should all be cleaned up, so they all have the correct width
, height
and an image of that size.
image.png?w=300&h=400
, orimage-300x400.png
, which I would then pick up via Mod_Rewrite and resize (and cache) on request? Is that an advantage over creating the resized images once (in that post-save action), and serving them as static files?