WordPress usually generates various image sizes when you upload images to the media library or directly to posts and pages (more about image sizes in this post). This is used mainly to create thumbnails and all the other sizes that are necessary to properly display images on your website.
Apart from the default sizes which can be defined in your settings, they are most often registered by your theme and sometimes by other plugins.
As we are using custom templates for picu collections instead of the ones from your theme, we don’t need to generate all of the themes’ image sizes and register our own instead. This makes uploads much faster, as we only create exactly what we need for the proofing layouts. This only affects images uploaded through picu and not anywhere else on your website.
Change the maximum image size used in proofing collections
By default, the largest size is set to a maximum of 3000 x 2000 pixels. But in some cases – e. g. if you want to display your images even larger – it makes sense to change this, which can be done using the picu_large_image_size
filter:
function my_picu_large_image_size( $sizes ) {
return array(
'width' => 3000,
'height' => 2000
);
}
add_filter( 'picu_large_image_size', 'my_picu_large_image_size' );
Code language: PHP (php)
Disable custom image sizes completely
Please be aware that this is not recommended in most cases, but if you know what you’re doing and you would like to disable the creation of the picu image sizes altogether, you could do so by using the picu_intermediate_image_sizes
filter:
function my_picu_disable_custom_image_sizes( $sizes ) {
return array();
}
add_filter( 'picu_intermediate_image_sizes', 'my_picu_disable_custom_image_sizes' );
Code language: PHP (php)
IMPORTANT: Make sure to add this code to a custom plugin, or by using the code snippets plugin, to make sure the changes don’t get overwritten by future theme updates.