Register an additional image size for only some images in my media library

There is a type of post on my blog which requires one extremely large image (such that it can be zoomed). I don’t want to register a new image size, because I only need a certain small subset of images to have this large image size. I have managed to generate this additional large image and it sits alongside the other three “generated” images in the uploads directory, however since it is not registered with the Media Library, it does not get uploaded to the image CDN with W3 Total Cache.

Can anyone suggest a better approach to my problem? Or suggest how I might register that large image with the media library (without it automatically creating the other image sizes which would not be needed). Or is there perhaps a way to register an additional image size for only some images in my media library?

Related posts

1 comment

  1. Since you know the location of the image on the disk you can use wp_insert_attachment to insert your big image to the media library. By default this will generate also several smaller versions of the big image that you might not need but this is the easiest way to make all the media related plugins to be aware to your image.

Comments are closed.