Skip to content

Intermediate images

By default, a set of alternate sizes are generated for images that are uploaded to a site’s WordPress media library. These alternate sizes are referred to as “intermediate images”. WordPress Core defines a default array of intermediate image sizes: thumbnailmedium, medium_large, and large. The pixel dimensions for each of these default sizes can be defined in the Settings –> Media screen of the WordPress Admin dashboard.

On a typical WordPress install, intermediate image sizes are generated as separate files (e.g., image-150x150.jpg, image-300x300.jpg).

On the VIP Platform, separate files are not created for intermediate images. Only the original (full) size version of the uploaded file is stored on the VIP File System. The intermediate sizes for an image are dynamically generated at the time of a request (e.g., image.jpg?w=150&h=150&crop=1, image.jpg?w=300&h=300&crop=1), and then cached by the edge cache.

Additional custom intermediate image sizes can be registered for a site with the add_image_size() function in a theme or a plugin.

Because intermediate image sizes are dynamically generated, the separate intermediate image files generated by typical WordPress install are not needed on VIP. When preparing content for importing media to an application, avoid including intermediate images. This can reduce the size of the exported content by up to 95% and increase the speed of the import.

Limitations

Because of VIP’s custom method for handling intermediate image sizes, some WordPress functions will not work as expected.

Intermediate image sizes in WordPress templates

Functions such as wp_get_attachment_image() or the_post_thumbnail() can be used to output images of a specific registered image size in a WordPress template. For example: the_post_thumbnail( 'medium' );.

These functions will not only output an image at a specific size, but will generate a responsive srcset for the image as well.

Last updated: December 26, 2023

Relevant to

  • WordPress