WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
365 stars 99 forks source link

Automatically opt into 1536x1536 and 2048x2048 sizes when generating fallback images #1512

Open adamsilverstein opened 2 months ago

adamsilverstein commented 2 months ago

Feature Description

As discussed in https://github.com/WordPress/performance/pull/1421 when "generate fallback images" is enabled, we should generate all of the sizes that core generates by default in both mime types (the uploaded type which could be JPEG or PNG and the output type which could be AVIF or WebP).

This includes two "extra" sizes that were added to the image generation routines later than the original sizes: 1536x1536 and 2048x2048 (typically these are used for high DPI screens).

felixarntz commented 2 months ago

For reference: https://github.com/WordPress/performance/pull/1421#issuecomment-2315636957 describes how the opt-in should work, using the approach in the way it's currently intended via "hypothetical" WP core API.

In core, this would happen via the add_image_size() calls. Since we're in plugin scope, we would accomplish the same outcome by directly modifying the corresponding global.