我不确定这个网站是否通过HTML重新调整图像大小,或者图像大小是否自动添加到代码中。
如果图像正在调整大小,则需要修复此问题,因为它会减慢页面加载时间。
您需要覆盖默认的theme_image并删除width
和height
属性,或者将它们的值设置为auto
。
的例子:
// In your theme's template.php file
function [YOUR_THEME]_image($variables) {
$attributes = $variables['attributes'];
$attributes['src'] = file_create_url($variables['path']);
foreach (array('alt', 'title') as $key) {
if (isset($variables[$key])) {
$attributes[$key] = $variables[$key];
}
}
return '<img' . drupal_attributes($attributes) . ' />';
}