0
我在我的数据库中有一些图像的网址,我想将它们与我的本地图像进行比较而无需下载它们。如何比较本地图像和网络图像而不写?
我读this example和this question 和我想这
adr = "url_of_image"
file = cStringIO.StringIO(urllib.urlopen(adr).read())
img = Image.open(file)
img = str(img)
print type(img)
image_file = open('adresse_of_image_in_local').read()
print type(image_file)
if (img == image_file):
print "the pictures of the same"
else :
print "they are not the same"
我测试相同的图像的代码,但我得到这个
<type 'str'>
<type 'str'>
they are not the same
我的问题是如何能比的图像本地与网络上的图像没有保存?