Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/04/2013, 17:22
Avatar de alex_dh
alex_dh
 
Fecha de Ingreso: septiembre-2011
Ubicación: Kreuzberg
Mensajes: 235
Antigüedad: 12 años, 7 meses
Puntos: 14
error al redimensionar imagen

hola de nuevo

con el script de Jcrop pude lograr redimencionar una imagen y almacenarla... la probe desde 000webhost, y funciona... la probe desde Dattatec y la imagen "ya redimencionada" es una imagen de color negro:



estoy usando este script, me fije si el formulario que indica las dimenciones a cortar envia bien los datos, y si... hice el mismo script en webhost y funciona perfecto...

Código PHP:
<?php
session_start
();

if(
$_SESSION['log'] == 'si') {
    
$x mysql_escape_string(htmlspecialchars($_POST['x']));
    
$y mysql_escape_string(htmlspecialchars($_POST['y']));
    
$w mysql_escape_string(htmlspecialchars($_POST['w']));
    
$h mysql_escape_string(htmlspecialchars($_POST['h']));
    
    if(empty(
$x) || empty($y) || empty($w) || empty($h)) {
        
header('location: ?eu=1');
    } elseif(
is_numeric($x) && is_numeric($y) && is_numeric($w) && is_numeric($h)) {
        
$targ_w $targ_h 130;
        
$jpeg_quality 100;
        
$src 'imagen.jpg';
        
$img_r imagecreatefromjpeg($src);
        
$dst_r imagecreatetruecolor($targ_w$targ_h);

        
imagecopyresampled($dst_r$img_r00$x$y$targ_w$targ_h$w$h);
        
header('Content-type: image/jpeg');
        
imagejpeg($dst_rnull$jpeg_quality);
    }
} else {
    
header('location: /');
}
?>
__________________
Avanzado desarrollador HTML, CSS y programador PHP, MYSQL, JAVASCRIPT

=========CALLEJEROS INOCENTES=========