2
我有一个问题,取决于imagemagick: 是否有可能只上传一张大小为1200像素高度的图片,例如 - 取决于设备或浏览器分辨率 - 降低图像高度AND图像的大小?图像或图形自动图像缩放
在此先感谢
我有一个问题,取决于imagemagick: 是否有可能只上传一张大小为1200像素高度的图片,例如 - 取决于设备或浏览器分辨率 - 降低图像高度AND图像的大小?图像或图形自动图像缩放
在此先感谢
您可以使用条件取决于设备或浏览器版本。假设你喜欢的folling图像高度之间切换:
然后输入此部分到您的模板常量:
# for IE6:
[browser = msie] AND [version = 6]
styles.content.imgtext {
maxH = 600
maxHInText = 600
}
# for mobile devices:
[useragent = *iPhone*]||[useragent = *iPod*]||[useragent = *Android*]||[useragent = *OperaMini*]||[useragent = *BlackBerry*]
styles.content.imgtext {
maxH = 320
maxHInText = 320
}
# For all other browsers
[else]
styles.content.imgtext {
maxH = 800
maxHInText = 800
}
[GLOBAL]
为模板设置替代溶液(在下面解释):
# for IE6:
[browser = msie] AND [version = 6]
tt_content.image.20.1.file {
maxH = 600
maxHInText = 600
}
# for mobile devices:
[useragent = *iPhone*]||[useragent = *iPod*]||[useragent = *Android*]||[useragent = *OperaMini*]||[useragent = *BlackBerry*]
tt_content.image.20.1.file {
maxH = 320
maxHInText = 320
}
# For all other browsers
[else]
tt_content.image.20.1.file {
maxH = 800
maxHInText = 800
}
[GLOBAL]
useragent
无法正常工作,请尝试使用扩展名cwmobileredirect。它提供了一个非常可靠的移动设备开关。maxW
)可以正常工作,但在4.2以下的版本中设置高度(maxH
)会有问题。如果出现maxH问题,请使用替代解决方案。
好吧,这可以帮助我很多,但它是重要的知道,如果图像将加载其真正的大小或他们调整更小的大小?你知道我的意思? –
Imagemagick实际上会为您生成图像大小,因此在这种情况下会创建三个不同的文件。它们没有缩放。 – Mateng
完美的解决方案! :) –