![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
bored
Industry Role:
Join Date: Aug 2003
Location: Metaverse
Posts: 4,675
|
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.
__________________
# ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
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?
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
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.
__________________
/(bb|[^b]{2})/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Coupon Guru
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
|
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
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more! AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
sex dwarf
Join Date: May 2002
Posts: 17,860
|
Quote:
__________________
/(bb|[^b]{2})/ |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Quote:
Ding ding ding ding ding ding! We have a winna! Thanks for playing. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
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/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Coupon Guru
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
|
Quote:
![]()
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more! AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2005
Location: Springfield
Posts: 13,826
|
compare md5 hashes:
Code:
$hash = md5_file($f); more info about the function http://php.net/manual/en/function.md5-file.php
__________________
Make a bank with Chaturbate - the best selling webcam program ![]() ![]() ![]() Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!! PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email: ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,391
|
CRC.... is your friend.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Join Date: Oct 2005
Location: California
Posts: 395
|
I agree with this. An md5 hash on all images uploaded then if you index the md5 field it won't take long to do the lookups.
|
![]() |
![]() ![]() ![]() ![]() ![]() |