![]() |
How to compare uploaded images to see if they exist already?
I'm trying to think of a way to compare uploaded images with ones that have already been uploaded. Weirdos for some reason are the most common ones that like to keep resubmitting their ugly nasty shit repeatedly. Anyone have any ideas on how this could be done? I'm thinking maybe use PHP's file_get_contents() to compare with ones already in the database but I don't really want to run thousands of comparisons 10-100 times (10,000-100,000 comparisons).
I could store a cookie on their computer so they can't submit again but what if they're submitting new stuff? |
only thing i can think of is the file_get_contents too lol
i think you'd only need to store the first 1000 characers of each pic tho. just put the strings in a cached txt file. then u can search the txt file when a new pic is added. |
Make the admin-delete function put the md5 hash of images in a database when you delete them, check md5 hashes of new uploads against that database?
|
Oh, wait, you're not deleting the originals.
In that case, just create a database with the md5 hashes of all new uploads, and check additional uploads against that database. |
can't you make a hash of each file uploaded, then compare the new photo's hash to the stuff already uploaded?
http://www.w3schools.com/php/func_string_md5.asp |
Quote:
|
Quote:
Ding ding ding ding ding ding! We have a winna! Thanks for playing. |
they can just modify the image a bit and your md5 will not match.
If you're looking for something more advanced see: http://www.phash.org/ |
Quote:
|
Quote:
|
compare md5 hashes:
Code:
$hash = md5_file($f); more info about the function http://php.net/manual/en/function.md5-file.php |
CRC.... is your friend.
|
Quote:
|
All times are GMT -7. The time now is 03:06 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc