try:
original = PythonMagick.Blob(data)
image = PythonMagick.Image(original)
except Exception as e:
raise errors.UnknownFileFormat()
medium = PythonMagick.Blob()
small = PythonMagick.Blob()
large = PythonMagick.Blob()
largesize = "128X128"
mediumsize = "64X64"
smallsize = "48X48"
image.scale(largesize)
image.write(large)
image.scale(mediumsize)
image.write(medium)
image.scale(smallsize)
image.write(small)
现在,我需要创建每个尺寸的基本图像,并将这些图像叠加在其上。这样,当我在具有固定宽度和高度的img标签中显示时,浏览器不会拉伸它们。缺乏文档让我感到很恼火。