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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-24-2009, 07:45 PM   #1
Jakez
Confirmed User
 
Jakez's Avatar
 
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?
__________________
[email protected] - jakezdumb - 573689400

Killuminati

Last edited by Jakez; 10-24-2009 at 07:48 PM..
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 08:02 PM   #2
plsureking
bored
 
plsureking's Avatar
 
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.
__________________
#
plsureking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 08:06 PM   #3
Libertine
sex dwarf
 
Libertine's Avatar
 
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})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 08:12 PM   #4
Libertine
sex dwarf
 
Libertine's Avatar
 
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})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 08:14 PM   #5
CYF
Coupon Guru
 
CYF's Avatar
 
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

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 08:17 PM   #6
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally Posted by CYF View Post
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
That's for strings, this is for files: http://php.net/manual/en/function.md5-file.php
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-24-2009, 09:48 PM   #7
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by Libertine View Post
just create a database with the md5 hashes of all new uploads, and check additional uploads against that database.

Ding ding ding ding ding ding! We have a winna! Thanks for playing.
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 01:21 AM   #8
darksoul
Confirmed User
 
darksoul's Avatar
 
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/
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 02:59 AM   #9
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by darksoul View Post
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/
Well if they modify the image a bit then it's not the same image technically. I know what you mean, but the average surfer who is uploading nude pics from their computer probably isn't doing a whole lot of editing and resubmitting, and if they are chances are at least one of the images are going to match a previous one. That should at least filter out all the usual bs submissions I'm trying to avoid, anyone that gets past it I can deal with manually.
__________________
[email protected] - jakezdumb - 573689400

Killuminati

Last edited by Jakez; 10-25-2009 at 03:01 AM..
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 03:06 AM   #10
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
Quote:
Originally Posted by Libertine View Post
That's for strings, this is for files: http://php.net/manual/en/function.md5-file.php
Good call. Been drinkin tonight and its 5am now rofl. Right idea, wrong link
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 08:01 AM   #11
HomerSimpson
Too lazy to set a custom title
 
HomerSimpson's Avatar
 
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:
HomerSimpson is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 08:58 AM   #12
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,391
CRC.... is your friend.
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2009, 09:53 AM   #13
fryer
Confirmed User
 
fryer's Avatar
 
Join Date: Oct 2005
Location: California
Posts: 395
Quote:
Originally Posted by Libertine View Post
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?
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.
__________________
fryer
WebCamClub/TextNDate Product Manager
icq: 576955851

fryer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.