Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Image Sizes Extras

No security coverage Under active development 4 sites

This module enhances the image sizes module by implementing browser-native srcset and dynamically setting the sizes attribute using a resize observer. This allows the browser to automatically select the appropriate image size for different screen resolutions and DPI values.

Purpose

This module adds a custom template and js implementation for the [image sizes](https://www.drupal.org/project/image_sizes) module.

What's different?

Instead of swapping the image url entirely, a browser native srcset is added. A resize observer sets the sizes attribute dynamically. Thus the browser can choose the correct image by itself. This also allows works with different DPI values. Just make sure that you preset is large enough.

E.g. If the image can be max 600px on your page then you should go up to 1200px width to support 2x dpi screens.

Potential Caveats

The preload image style width and height are used for the aspect ratio. This can cause slight layout shift when using image presets without fixed aspect ratios.

Drupal 9–11

Ask your assistant about Image Sizes Extras

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • image_sizes Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Jan 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.4 Stable 9–11 Aug 3, 2024
1.0.3 Stable 9–10 Aug 22, 2023
1.0.2 Stable 9–10 Jul 10, 2023
1.0.1 Stable 9–10 May 26, 2023
1.0.0 Stable 9–10 Feb 23, 2023
1.0.0-beta4 Pre-release 8–10 Jan 16, 2023
1.0.0-beta3 Pre-release 8–10 Jan 16, 2023