I want to find duplicate photos from photo library fast I'm using following code for retrieving duplicate image but its time taking :
UIImage *img1 = [imgArray objectAtIndex:i];
UIImage *img2 = [imgArray objectAtIndex:j];
NSData *data1 = UIImageJPEGRepresentation(img1, 1.0);
NSLog(@"%@",data1);
NSData *data2 = UIImageJPEGRepresentation(img2, 1.0);
NSLog(@"%@",data2);
            if ([data1 isEqualToData:data2])
            {
                    [duparray addObject:[imageArray objectAtIndex:i]];
                    [duparray addObject:[imageArray objectAtIndex:j]];
            }
            else
            {
                NSLog(@"no");
            }
getting the data and comparing 1000 photos waste of time can anyone help me for this, help will be appreciated.. thank you
 
     
    