Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 962829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:34:18+00:00 2026-05-16T01:34:18+00:00

I have over 10K files for products, the problem is is that many of

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:34:19+00:00Added an answer on May 16, 2026 at 1:34 am

    I wrote a script for this a while back. First it scans all files, noting their sizes in a dictionary. You endup with:

    images[some_size] = ['x/a.jpg', 'b/f.jpg', 'n/q.jpg']
    images[some_other_size] = ['q/b.jpg']
    

    Then, for each key (image size) where there’s more than 1 element in the dictionary, I’d read some fixed amount of the file and do a hash. Something like:

    possible_dupes = [size for size in images if len(images[size]) > 1]
    for size in possible_dupes:
        hashes = defaultdict(list)
        for fname in images[size]:
            m = md5.new()
            hashes[ m.update( file(fname,'rb').read(10000) ).digest() ] = fname
        for k in hashes:
           if len(hashes[k]) <= 1: continue
           for fname in hashes[k][1:]:
               os.remove(fname)
    

    This is all off the top of my head, haven’t tested the code, but you get the idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We all know the effects that lots of thrown exceptions can have over the
I have over 250 subclasses that need instances made of them, and I can't
I have over 20 kml/kmz files that I let users add to a Google
I have over 1.3milion images that I have to compare with each other, and
I have over 125 TSV files of ~100Mb each that I want to merge.
I have a fairly large PHP codebase (10k files) that I work with using
I have over 30 aspx pages, i have discovered a problem recently that if
If I'm building an application that will have over 30 models, and I want
im planning to create a movie file that might have over 16,000 frames?i know
I have taken over a project that was build from suggestions in this Dan

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.