如何在 Blogger 上显示更高分辨率的缩略图
How to display higher-res thumbnails on Blogger
一直以来,我一直在使用 <img expr:src='data:post.thumbnailUrl'/>
在我的主页上显示缩略图,它输出一个 72x72 方形图像,最初是为移动浏览而制作的。然后我使用 jquery 将图像从 72-c 缩放到 s300。我想知道是否有其他方法可以在不使用 js 的情况下获取缩略图。
Blogger 发布的新模板集可以使用data:post.featuredImage 输出32、64、128 和256 像素的缩略图大小。我如何将其应用于自定义模板?
使用 resizeImage 运算符更改图像大小,无需 JavaScript。代码看起来像 -
<img expr:src='resizeImage(data:post.thumbnailUrl, 1600)'/>
resizeImage(imageUrl, newSize, optionalRatio)
The resizeImage operator takes 3 parameters:
imageUrl - The original URL of the resizable image.
newSize - The new
width of the image
(optional) ratio - The integer ratio of width to
height for the resized image, e.g. “1:1” or “4:3”
Notes
If the imageUrl parameter is not a resizable image, the resizeImage
function will return the original imageUrl.
The ratio must be integer
numbers.
If the ratio is provided, the image will be cropped to those
exact dimensions.
一直以来,我一直在使用 <img expr:src='data:post.thumbnailUrl'/>
在我的主页上显示缩略图,它输出一个 72x72 方形图像,最初是为移动浏览而制作的。然后我使用 jquery 将图像从 72-c 缩放到 s300。我想知道是否有其他方法可以在不使用 js 的情况下获取缩略图。
Blogger 发布的新模板集可以使用data:post.featuredImage 输出32、64、128 和256 像素的缩略图大小。我如何将其应用于自定义模板?
使用 resizeImage 运算符更改图像大小,无需 JavaScript。代码看起来像 -
<img expr:src='resizeImage(data:post.thumbnailUrl, 1600)'/>
resizeImage(imageUrl, newSize, optionalRatio)
The resizeImage operator takes 3 parameters:
imageUrl - The original URL of the resizable image.
newSize - The new width of the image
(optional) ratio - The integer ratio of width to height for the resized image, e.g. “1:1” or “4:3”Notes
If the imageUrl parameter is not a resizable image, the resizeImage function will return the original imageUrl.
The ratio must be integer numbers.
If the ratio is provided, the image will be cropped to those exact dimensions.