I am using drupal 9.2 latest version. For images height and width are setting automatically also
loading = 'lazy'
this attribute added in every images in website.
I tried to unset these attributes using the below hook.
function theme_preprocess_image(&$var) {
$var['attributes']['loading'] = 'auto';
unset($var['height'], $var['width']);
}
But the hook is not triggered. Is there anything need to change in configuration for latest version.