I have images that I upload to a server using Amazon S3. I convert them to NSData, using UIImageJPEGRepresentation with 0.75f compression quality. Now I'd like to compare them and see if they are equal.
With PNG, it's easy, all I had to do is this:
if (UIImagePNGRepresentation(self.pictureImageView.image) isEqual:
UIImagePNGRepresentation(manageItemVC.pictureImage)]) {}
as stated here. And that would work, but now the images are JPEG, and the comparison isn't working (most likely due to compression), even if I use UIImageJPEGRepresentation.
self.pictureImageView.image is the image from the server that I've loaded into an UIImageView, and manageItemVC.pictureImage is an image that the user picked from the photo library.
Anyone know how to compare JPEG images?