Posted by BLob on 09/27/91 11:44
> Does anyone know a simple way to compare two images to see if they are
> the same? The filenames of the images will be different, but if the
> image data is the same I would like to test for that.
Just compare the md5 codes of the two files :
if (md5(file_get_contents($filename01)) ==
md5(file_get_contents($filename02))) {
echo "The files are the same";
} else {
echo "The files are not the same";
}
> The files will be jpeg images.
The md5 should work for any type of file.
BLob
[Back to original message]
|