I want to store the images to photo gallary. But if images are already available at photo gallary then how to distinguish for whether imgaes are already exists or not? I didnt find property like unique identifier or should i compare by taking data in the form of NSdata?
thanks..
You can go to Settings > Camera > Toggle off the option Keep Normal Photo. After editing photos, it is suggested to delete original photos in time to avoid your iPhone saving too many similar photos.
Duplicate images can happen due to syncing errors or syncing folders multiple times — or simply taking too many photos of the same thing. You can remove duplicates with third-party apps (we recommend Gemini Photos) or by doing it manually. Removing duplicates allows you to free up more storage on your iPhone.
You can maintain a dictionary of hashes for each the image in the photo gallery, and then show only additional images who do not hashes are not present in the dictionary
As a reminder, you can check for an object in a dictionary by doing:
if ([myDictionary objectForKey:variableStoringImageHash] == nil) {
//No such image present
}
else {
//image is present
}
For a bit about hashing an image, this might help: iPhone: fast hash function for storing web images (url) as files (hashed filenames)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With