【发布时间】:2015-11-22 22:38:06
【问题描述】:
我想获取图片的内容类型,我正在做
image = open(PATH_TO_IMAGE)
print(image.name.content_type)
告诉我 str 对象没有属性 content_type 的错误
如何获取内容类型?
我在测试中这样做,在我看来,我得到了图像的 content_type。我可以将图像传递给视图,但它没有给我内容类型
【问题讨论】:
标签: python django identification imghdr