  It is shown that gravitating magnetic fields affect the evolution of
curvature perturbations in a way that is reminiscent of a pristine
non-adiabatic pressure fluctuation. The gauge-invariant evolution of curvature
perturbations is used to constrain the magnetic power spectrum. Depending on
the essential features of the thermodynamic history of the Universe, the
explicit derivation of the bound is modified. The theoretical uncertainty in
the constraints on the magnetic energy spectrum is assessed by comparing the
results obtained in the case of the conventional thermal history with the
estimates stemming from less conventional (but phenomenologically allowed)
post-inflationary evolutions.
