Foros del Web » Programando para Internet » PHP »

Imagenes en miniatura me salen en negro.. necesito ayuda!!

Estas en el tema de Imagenes en miniatura me salen en negro.. necesito ayuda!! en el foro de PHP en Foros del Web. aludos Es la tercera vez que posteo esto en ese foro, ojala obtenga ayuda. Tengo una aplicacion en PHP que sube las imagenes a una ...
  #1 (permalink)  
Antiguo 20/04/2008, 21:14
 
Fecha de Ingreso: enero-2008
Mensajes: 25
Antigüedad: 16 años, 3 meses
Puntos: 0
Exclamación Imagenes en miniatura me salen en negro.. necesito ayuda!!

aludos

Es la tercera vez que posteo esto en ese foro, ojala obtenga ayuda. Tengo una aplicacion en PHP que sube las imagenes a una carpeta y a la vez, genera una miniatura de 150 x 113, pero la miniatura sale con fondo negro y no captura la imagen.. que puede ser el problema y cómo se puede solucionar? Aqui paso el codigo:

<?
if (isset($subir)) {
header("Location: subir.php");
}
?>
<?
$subir = $_FILES['subir']['name'];

$direct = "pics/";
$nombre1 = $_FILES['subir']['name'];
//copiar archivo
move_uploaded_file( $_FILES['subir']['tmp_name'], $direct.$nombre1 );

//borrar temp file
@unlink($_FILES['subir']['tmp_name']);
?>
<?php
// File and new size
$otogra = $_FILES['subir']['name'];
$filename = $otogra;
//$percent = 0.5;

// Content type
header('Content-type: image/jpeg');
header('Content-type: image/jpg');
header('Content-type: image/gif');

// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = 150;
$newheight = 113;

// Load

$nombre = "thumb_".$filename;
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);

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

// Output
@imagejpeg($thumb, $nombre, 80);
@imagejpeg($thumb, '', 80);
@imagedestroy($nombre);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
GRACIAS.. GRACIAS!!
</body>
</html>
  #2 (permalink)  
Antiguo 21/04/2008, 02:34
Avatar de jerkan  
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 18 años, 7 meses
Puntos: 19
Re: Imagenes en miniatura me salen en negro.. necesito ayuda!!

Duplicar temas no está bien visto por los administradores. Lo mejor que puedes hacer en estos casos es responder en el mismo tema para que 'suba' en el listado.
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 07:02.