【发布时间】:2017-03-24 01:54:33
【问题描述】:
如果我们的模型定义如下,如何找到图像的高度和宽度
class MModel:
document = FileField()
format_type = CharField()
并且图像保存在文档中,那么如果它是图像,我们如何找到文档的高度和宽度?
【问题讨论】:
-
您可以将其更改为
ImageField并使用width_field和height_field参数。 -
你是说 ImageField(MModel.objects.all()[0]).height ??
标签: python django image models filefield