【发布时间】:2015-02-01 23:58:01
【问题描述】:
我在使用 ImageKit 时遇到了一些问题。当通过管理表单提交图像时,我希望将其调整为特定大小(320x450)。我目前的配置如下:
imagen = ProcessedImageField(upload_to='tapas',
processors=[ResizeToFit(width=320, height=450, upscale=True)],
format='JPEG',
options={'quality': 80},
null = True,
blank = True)
当提交的图像大于所需尺寸时,这非常有效,但对于较小的图像,它保持图像不变。我也尝试设置mat_color,但这也不起作用。我找不到 mat_color 应接收哪种格式的文档,但我尝试过使用 255、(255,255,255) 和 (255,255,255,0),但没有成功。
如果您能指导我找到解决方案,我将不胜感激。谢谢!
【问题讨论】:
标签: python django django-imagekit