Cloudinary provides you with two powerful criteria for determining duplications - one for identity comparison and the other for similarity:
- MD5 signature: The
"etag"attribute included in the upload response can be used for recognizing completely identical images.
pHash: If requested (
"phash" => true) this will be included in the upload response, allowing to commit a similarity check and distinguish how close the images are.
More information on pHash: http://www.phash.org/demo/
ETag as public_id: A cloud-level flag that can be enabled to tell Cloudinary to use the ETag value (MD5 checksum) of the resource as its public_id. The "Default Public ID" setting that allows the ETag as Public ID flag to be enabled can be found under the Settings -> Upload tab in your cloud. Note that this configuration is applied for all new uploads following the flag being enabled.
Checking image dimensions is always a good idea too. Using different hashes instead of just one reduces the chance of hash collisions.