Forum Moderators: coopster

Message Too Old, No Replies

Matching Pictures

         

ntbgl

5:57 am on Mar 1, 2009 (gmt 0)

10+ Year Member



What are different ways to tell if the picture is the same?

I know you could create a hash for each picture, and each match would be the same picture:

$hash1=md5(file_get_contents("file1.jpg");

But this doesn't match if the two pictures were saved using two different compression methods or settings.

What are other ways, ones preferably not too cpu intensive?

If it makes a difference, I will only be comparing .jpg files.

blang

6:05 am on Mar 1, 2009 (gmt 0)

10+ Year Member



Have you looked at the exif extension [php.net]? Although I'm not very familiar with it, it seems to have the capability to check image data in that regard.

ntbgl

4:55 pm on Mar 1, 2009 (gmt 0)

10+ Year Member



Thank you for youre reply.

No, I wasn't familiar with exif. It looked interesting, but once I tried all the functions on a data set sample, the only information I got was the filename, image type, image size and dimensions, all which I already knew. Reading on, it looked like there were some gains in speed which is good to keep in mind.

Any one else have any other ideas?