Foros del Web » Programando para Internet » PHP »

Cambiar tamaño de imagen

Estas en el tema de Cambiar tamaño de imagen en el foro de PHP en Foros del Web. Que tal, Tengo una galeria en la cual se generan thumbs, pero se generan de 138 x 138, y los quiero de 138x92 Como hago ...
  #1 (permalink)  
Antiguo 19/08/2010, 10:16
 
Fecha de Ingreso: julio-2010
Mensajes: 51
Antigüedad: 13 años, 9 meses
Puntos: 0
Cambiar tamaño de imagen

Que tal,

Tengo una galeria en la cual se generan thumbs, pero se generan de 138 x 138, y los quiero de 138x92

Como hago para cambiar la medida en la cual el sistema corta las fotos ? Este es el archivo:

Código PHP:
<?php 
//Thumbnail save settings, feel free to change these. Pre-existing thumbnails need to be deeted for the changes to take effect!!!
$thumbsize "138"// Thumbnail size.
$thumbquality "100"//the thumbnail JPEG quality.

// Image folder

$images $_GET['imagefolder'];

// Thumbnail folder

$thumbnails $_GET['thumbfolder'];

// The file you are resizing 
$file $_GET['im'];

//image name:
$tn_name $_GET['name'];

// This sets it to a .jpg, but you can change this to png or gif 
header('Content-type: image/jpeg'); 

// Setting the resize parameters 
list($width$height) = getimagesize($file);

if (
$width == $height) {
    
$modwidth $thumbsize;
    
$modheight $thumbsize;
}
else if (
$width $height) {
    
$zoom $thumbsize $width;
    
$modwidth $thumbsize;
    
$modheight $height $zoom;
    
$dstx 0;
    
$dsty = ($thumbsize $modheight)/2;

}
else {
    
$zoom $thumbsize $height;
    
$modheight $thumbsize;
    
$modwidth $width $zoom;
    
$dstx = ($thumbsize $modwidth)/2;
    
$dsty 0;
}

// Resizing the Image
$tn imagecreatetruecolor($thumbsize$thumbsize);
$image imagecreatefromjpeg($file);
imagecopyresampled($tn$image$dstx$dsty00$modwidth$modheight$width$height); 


ACA SIGUE PERO NO ES IMPORTANTE..

Gracias de antemano por su ayuda...
  #2 (permalink)  
Antiguo 19/08/2010, 10:51
 
Fecha de Ingreso: julio-2010
Mensajes: 51
Antigüedad: 13 años, 9 meses
Puntos: 0
Respuesta: Cambiar tamaño de imagen

Ah y ya que estoy pregunto una cosa mas.. por que cuando me descarge la galeria la linea de la calidad del .JPG figuraba 130 en vez de 100 ? Hay alguna razon ?

Código PHP:
Ver original
  1. $thumbquality = "130"; //the thumbnail JPEG quality.

Etiquetas: tamaño
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:04.