The script is great if it's run on a single case by case basis. If you run this script comparing many images and especially high res images it tends to run php out of memory around the 15-20 iteration.
I'm not a very good OOP coder, procedural I'm great at! This script needs some imagedestory statement(s) to reclaim memory.
IMO this is a far better way to compare image files rather than just comparing md5 sums.
Hope you can update the code or at the least tell me where to put in the imagedestroy statements.