我今天也注意到了这种行为,花了一些沉重的画廊才注意到它实际上是在为画廊提供我的高分辨率图像。我做了一个快速修复,它使用了可用的不同图像版本。
这是一个快速的'n'dirty修复,它应该真正检查所有已注册的图像大小
get_intermediate_image_sizes()
并按大小排序并返回正确的URL。好吧...这个修复将节省我的带宽和加载时间.. 我修补了 rectangle_talavera。在插件/slimjetpack/modules/tiled-gallery/tiled-gallery.php
$size = 'large';
if ( $image->width <= 150 ) {
$size = 'thumbnail';
} elseif ( $image->width <= 590 ) {
$size = 'medium';
}
$image_title = $image->post_title;
//$orig_file = wp_get_attachment_url( $image->ID );
$image_attributes = wp_get_attachment_image_src( $image->ID, $size ); // returns an array
$orig_file= $image_attributes[0];