Why Spain Is Different
26mm wide by 32mm high, set by the Ministerio del Interior.
The Spanish passport and DNI photo is 26mm wide by 32mm high, a specification set by the Dirección General de la Policía under the Ministerio del Interior. Almost every other EU country uses 35x45mm.
This matters if you live outside Spain. A photo booth in France, Germany or the Netherlands will produce a 35x45mm photo by default, and it is simply the wrong size for a Spanish document — tell the shop the dimensions, or crop it yourself.