K
K
Konstantin B.2015-08-28 09:18:09
PHP
Konstantin B., 2015-08-28 09:18:09

Unique picture data?

I want to limit the number of downloads of the same image. That is, one picture can be loaded only once, and the information can be entered into the database. What data is needed for this to be obtained from the image and how best to store it?
Is there anything else besides Exif ? Or will it be enough?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Martyanov, 2015-08-28
@vilgeforce

Exif can be removed. I didn't see it in PNG at all. If we are only talking about JPG and do not take into account image scaling - the file size and the last 256 bytes of the file must be quite unique.

M
Max, 2015-08-28
@MaxDukov

calculate and save the same MD5/SHA.
The method is suitable for any file.
however, if at least 1 bit changes in the file, the hash will be different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question