Using hash_file for image recognition
Without knowing much about your use case, the code looks straightforward. It does exactly what you specify and nothing more.

A few points:


The constant image hash can be defined as global(?)
Use === for comparison.