Is it possible to detect duplicate image files?

Viewed 15316

I have over 10K files for products, the problem is is that many of the images are duplicates.

If there is no image, there is a standard image that says 'no image'.

How can I detect if the image is this standard 'no image' image file?

Update The image is a different name, but it is exactly the same image otherwise.

People are saying Hash, so would I do this?

im = cStringIO.StringIO(file.read())
img = im.open(im)
md5.md5(img)
6 Answers

I had trouble installing PythonMagick on Fedora but Wand (another ImageMagick binding) worked.

from wand.image import Image

img = Image(filename="image.jpg")
print(img.signature)

Just be sure to install everything first:

yum install python3-wand ImageMagick
Related