1

我在整个网站上都使用简单的缩略图。它通常工作正常。但是现在我想为 Facebook 创建一个产品提要,并且图片需要是 600x600px 的正方形。

它看起来像这样:

thumbnailer = get_thumbnailer(v.product.image)
thumbnail_options = {
  'crop': '50,0', #tried smart, scale and all kinds of combos
  'size': (600, 600)
}
resized_image = thumbnailer.get_thumbnail(thumbnail_options)

问题是我总是将一个维度设置为 600 像素,而将另一个维度设置为 <600 像素。我可以让它做一些类似智能选项的事情,但以我得到方形图像的方式裁剪吗?

先感谢您!

4

1 回答 1

1
thumbnailer = get_thumbnailer(v.product.image)
thumbnail_options = {
  'crop': 'smart',
  'upscale': True,
  'size': (600, 600)
}
resized_image = thumbnailer.get_thumbnail(thumbnail_options)
于 2016-05-27T07:39:57.890 回答