如何在Blogger上显示高分辨率缩略图 [英] How to display higher-res thumbnails on Blogger

查看:138
本文介绍了如何在Blogger上显示高分辨率缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直以来,我一直使用<img expr:src='data:post.thumbnailUrl'/>在主页上显示缩略图,该缩略图输出最初用于移动浏览的72x72正方形图像.然后,我使用jquery将图像从72-c缩放到s300.我想知道是否有一种不使用js来获取缩略图的方法.

All this time I've been using <img expr:src='data:post.thumbnailUrl'/> to display thumbnails on my homepage, which outputs a 72x72 square image originally made for mobile browsing. I then use jquery to scale the image from 72-c to s300. I wonder if there's a different approach to get a thumbnail without using js.

Blogger发布的新模板集可以使用data:post.featuredImage输出32、64、128和256像素的缩略图大小.如何将其应用于自定义模板?

The new set of templates released by Blogger can output a thumbnail size available in 32, 64, 128 and 256 px using data:post.featuredImage. How can I apply this to custom templates?

推荐答案

使用 resizeImage 运算符可在不使用JavaScript的情况下更改图像大小.代码看起来像-

Utilize the resizeImage operator to change image size without JavaScript. The code will look like -

<img expr:src='resizeImage(data:post.thumbnailUrl, 1600)'/> 

resizeImage(imageUrl,newSize,optionalRatio)

resizeImage(imageUrl, newSize, optionalRatio)

resizeImage运算符采用3个参数:

The resizeImage operator takes 3 parameters:

imageUrl -可调整大小的图像的原始URL.
newSize -新 图片的宽度
(可选)比率-宽度与 调整大小后的图片的高度,例如"1:1"或"4:3"

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"

注释

如果imageUrl参数不是可调整大小的图像,则resizeImage 函数将返回原始imageUrl.
比率必须为整数 数字.
如果提供了比例,图像将被裁剪为那些 确切尺寸.

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.

这篇关于如何在Blogger上显示高分辨率缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆