Con este script basándonos en JQuery nos sera fácil redimensionar una imagen o varias imágenes según las capas aquellas imágenes que superen en x tamaño la anchura. También se puede utilizar la altura como medida pero bueno con unos pequeños ajustes no hay mayores problemas.
jQuery(document).ready(function(){
  jQuery('.content img.imagefield').each(function(){
    var width = jQuery(this).width();
    var new_width = 680; //nuevo tamaño
    if (width > new_width){
      var height = jQuery(this).height();
      var calculo = Math.round((100*new_width)/ width); //porcentaje
      var new_height = Math.round((height*calculo)/100);
      jQuery(this).css( {
        width : new_width+'px',
        height : new_height+'px'
      } );
    }
  });
});
Comentarios