I have 2 same images with different Image properties and file properties (e.g. CreationDate, etc.). When I calculate hash, I get different hashes. Is there any way to skip such properties and calculate hash to get same hashes?
Awaiting help. Thanks
I have 2 same images with different Image properties and file properties (e.g. CreationDate, etc.). When I calculate hash, I get different hashes. Is there any way to skip such properties and calculate hash to get same hashes?
Awaiting help. Thanks
You can read the image data into a byte array and hash that byte array.
That way, differences in meta-data would not be considered.
Since the 2D data is read into a 1D array, you can construct cases where two images with different dimensions have the same hash. For example, consider a 2x2 image and a 4x1 image. R means red and B means blue (just to pick two colors)
RB
BR
and
RBBR
Both would have the same hash code. If that matters to you, prepend (or append) the width and height of the image to the byte array before hashing.