Les agrego el código de la función que utilizo:
Código PHP:
function resizeImage($originalImage,$toWidth,$toHeight)
{
$info = getimagesize($originalImage);
$width = $info[0];
$height = $info[1];
$type = image_type_to_mime_type($info[2]);
$interlace = true;
if( $width >= $height )
$width = $height;
else
$height = $width;
//Percentage Change
$newWidth = ( 20 / 100 ) * $width;
$newHeight = ( 20 / 100 ) * $height;
//Width change
$newWidth = 89;
$newHeight = ( $height * $newWidth ) / $width;
//Height change
$newHeight = 67;
$newWidth = ( $width * $newHeight ) / $height;
$newImage = imagecreatetruecolor( $newWidth , $newHeight );
imageinterlace( $newImage , $interlace );
$image = imagecreatefromjpeg($originalImage);
imagecopyresampled($newImage ,$image , 0 , 0 , 0 , 0 , $newWidth , $newHeight , $width , $height );
switch($type)
{
case 'image/jpeg':
imagejpeg($newImage ,$image,100);
break;
case 'image/gif':
imagegif($newImage ,$image,100);
break;
case 'image/png':
imagepng($newImage ,$image, 100 );
break;
}
return $newImage;
}
Código PHP:
...mas codigo...
$image = resizeImage($b['Photos']['Photo_attr']['src'],89,67);
//print_r($image);
$imagen = '<img src="'.get_template_directory_uri() . '/'.$image.'" align="left" border="none" />';
...mas codigo...
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
Les agradesco de antemano su ayuda.
Saludos