Possible Duplicate:
How does one compare one image to another to see if they are similar by a certain percentage, on the iPhone?
I've found this code and am trying to understand it better:
UIImage *img1 = // Some photo;
UIImage *img2 = // Some photo;
NSData *imgdata1 = UIImagePNGRepresentation(img1);
NSData *imgdata2 = UIImagePNGRepresentation(img2);
if ([imgdata1 isEqualToData:imgdata2]) {
NSLog(@"Same Image");
}
Will this confirm that image 1 is exactly the same as image 2? Is this method best practice, or is there a better approach to this?