If you know the images have not been modified after being uploaded, then you could compare checksums (MD5 or SHA) for each file. An example might progress like:

use strict; use Digest::MD5; my (%files); my $md5 = Digest::MD5->new; foreach my $dir ( @ARGV ) { next unless (-d $dir); foreach my $f (<$dir/*>) { next if (-d $f); open(FILE, $f) or die qq{Can't open $f: $!\n}; binmode(FILE); $md5->addfile(*FILE); close(FILE); push(@{$files{$md5->hexdigest}}, $f); $md5->reset; } } print qq{The following entries appear to be duplicates, }; print qq{and warrant closer examination:\n}; foreach my $k ( keys %files ) { if ( scalar @{$files{$k}} > 1 ) { print qq{\t}, q{Checksum: }, $k, qq{\n}; print qq{\t\t}, join( qq{\n\t\t}, @{$files{$k}} ), qq{\n}; } }

This will give you output that looks like the following (actual file names changed to protect the clueless):

$ ./compare-test.pl . The following entries appear to be duplicates, and warrant closer examination: Checksum: d41d8cd98f00b204e9800998ecf8427e ./file-01.txt ./file-1.txt ./file01.txt ./file1.txt Checksum: 520bd68306a6bd9aa586a80ee692c750 ./file-2.txt ./file2.txt Checksum: 024cde173d464feee746320b300b5c35 ./file-04.txt ./file04.txt Checksum: 3ef60d5a2fa552f395e154bb5418893c ./file-5.txt ./file5.txt

Hope that helps.


In reply to Re: compare images by atcroft
in thread compare images by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.