1

I'm not talking titles / name, I mean pixel analyzation or perhaps bitmapping... perhaps an OCR?

I need to reduce the server usage by not using duplicate media so if a person is trying to upload a photo that is already on the server uploaded by someone else, that photo will not be uploaded.

janicehoplin
  • 277
  • 6
  • 15
  • 1
    You don't know if they are the same untill you chech all pixels :) But checking 100 random pixels would be ok. – magic-sudo Apr 06 '15 at 12:22
  • I had this thought of laying two pictures over each other and if the photos are exactly the same then you would get the first photo times two right? I don't know if that makes sense / is possible but would be cool / simple. – janicehoplin Apr 06 '15 at 12:48
  • Try reading this: http://stackoverflow.com/questions/843972/image-comparison-fast-algorithm – Dalton Maratone Apr 06 '15 at 20:51

1 Answers1

2

I do not know about the what technology you are using.

But, I believe you may use md5 check for that. MD5 check are a good way to solve file comparison and it has for a lot of technologies.

  • how is that on overhead though? If you had a thousand people uploading at once and each photo has to be checked, is that dumb? Maybe I could accept the photo/file first, then check later perhaps when the network traffic is lower, for duplicates to conserve on storage? – janicehoplin Apr 06 '15 at 12:48
  • 1
    You could save the md5 text value in another database's table thus you could check that after for a thousand times with a good performance. The relationship between two (picture x md5 text) could be by foreign key (for a ER model). – Dalton Maratone Apr 06 '15 at 15:53
  • 1
    Probably this won't work due to different time and date or am I mistaken? – magic-sudo Apr 06 '15 at 20:37
  • 1
    It could be useful: http://stackoverflow.com/questions/843972/image-comparison-fast-algorithm – Dalton Maratone Apr 06 '15 at 20:50
  • thanks for the replies. When I reach this stage, I'll decide if it is even worth implementing or not eg. just buy more storage. – janicehoplin Apr 07 '15 at 04:59
  • Sure, but my regard about that is to us keep in our minds "The software should do its goals spending less resources as possible". It is a good approach to us consider as software engineers. – Dalton Maratone Apr 07 '15 at 14:58
  • 1
    I was thinking, if you inverted an image then overlayed two images that are supposed to be the same then you would get a blank image right? Not sure if it would be white or black. – janicehoplin May 07 '15 at 00:14