Simple Python app allows interactively zooming and translation of a photo to fit passport photo requirements.
Example of fitting requirements of Chinese passport or visa photo:
Example of fitting requirements of USA passport or visa photo:
The tool can be found at https://github.com/binglongx/PassportPhoto.