Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/01/2008, 13:27
robertop69
 
Fecha de Ingreso: enero-2008
Mensajes: 5
Antigüedad: 16 años, 4 meses
Puntos: 0
Cambio de Hosting = muchos problemas

Recientemente cambie de proveedor y me encontré con varios problemas, los cuales estoy solucionando poco a poco, pero este me esta volviendo LOCO.
UPLOAD DE IMAGEN Y TRATAMIENTO ONLINE.

Este codigo lo tenia funcionando sin problemas en mi antiguo hosting con register_globals = on
En mi nuevo hosting con register_globals = off no funciona y me tira los siguientes errores.

Warning: imagesx(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 14

Warning: imagesy(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 15

Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 29

Warning: imagesx(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 42

Warning: imagesy(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 43

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 56

Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 57

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 63

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/mundoas/public_html/usuarios/noticias/UPalta.php on line 64

Formulario y codigo PHP unificado:

<?php
$Cosa=$_POST['Cosa'];
if($Cosa=="0"){
error_reporting(7);
$NomImage=$HTTP_POST_FILES['image']['name'];
$Tipo=$HTTP_POST_FILES['image']['type'];
echo $NomImage." ".$Tipo;

$NomImage=date("dmy_Gis")."_".$NomImage;
$imagen_gra = ImageCreateFromJPEG($image);
$ancho_gra = imagesx($imagen_gra);
$alto_gra = imagesy($imagen_gra);

// la bajo a 220 de ancho
$ancho = $ancho_gra;
$alto = $alto_gra;
while($ancho>220){
$restaAn=$ancho*1/100;
$restaAl=$alto*1/100;
$ancho=$ancho-$restaAn;
$alto=$alto-$restaAl;
}
$imagen_destino = ImageCreatetruecolor($ancho, $alto);
imagecopyresized($imagen_destino, $imagen_gra, 0, 0, 0, 0, $ancho, $alto, $ancho_gra, $alto_gra);
$nombre_destino_gra = $NomImage;
ImageJPEG($imagen_destino,$nombre_destino_gra,100) ;
ImageDestroy($imagen_destino);

// Armo otra reduccion a tamaño tumb
$ancho=0;
$alto=0;
$imagen_chi = ImageCreateFromJPEG($image);
$ancho_chi = imagesx($imagen_chi);
$alto_chi = imagesy($imagen_chi);
// la bajo a 160 de ancho
$ancho = $ancho_chi;
$alto = $alto_chi;
while($ancho>160){
$restaAn=$ancho*1/100;
$restaAl=$alto*1/100;
$ancho=$ancho-$restaAn;
$alto=$alto-$restaAl;
}
$imagen_destino = ImageCreatetruecolor($ancho, $alto);
imagecopyresized($imagen_destino, $imagen_chi, 0, 0, 0, 0, $ancho, $alto, $ancho_chi, $alto_chi);
$nombre_destino_chi = "tmb_".$NomImage;
ImageJPEG($imagen_destino,$nombre_destino_chi,100) ;
ImageDestroy($imagen_destino);
}else{
?>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<p align="center">Archivo
<input name="image" type="file" id="image">
<input type="hidden" name="Cosa" value="0">
</p>
<p align="center"><input name="boton" type="submit" id="boton" value="Enviar"></p>
</form>
<? } ?>


les agradezco mucho cualquier aporte !!!