The production of mesons by photons and electrons