Ver Mensaje Individual
  #8 (permalink)  
Antiguo 19/09/2006, 11:21
Avatar de seyacat
seyacat
 
Fecha de Ingreso: agosto-2006
Mensajes: 382
Antigüedad: 17 años, 8 meses
Puntos: 0
Asi manipulas un JPG, asugurate que tu php soporte la libreria GD

<?php
// Variables que indican el archivo de la imagen y el nuevo tamano
$filename = 'sexi06.jpg';
$ancho = 50;
$alto = 50;
$percent = 0.5;

// Content-type para el navegador
header('Content-type: image/jpeg');

// Se obtienen las nuevas dimensiones
list($width, $height) = getimagesize($filename);
$newwidth = $ancho;
$newheight = $alto;

// Cargar la imagen
$thumb = imagecreate($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);

// Redimensionar
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

// Mostrar la nueva imagen
imagejpeg($thumb);
//imagegif($thumb);
?>