Ya no deseo enviar por cabecera.

  • Autor Autor Prospero
  • Fecha de inicio Fecha de inicio
Prospero

Prospero

Eta
Verificación en dos pasos activada
Hola amigos tengo el siguiente codigo, con la cual redimenciona excelentemente. pero la imagen me la muestra por cabecera ya probe de todo y no logre sacarla, como hago para que solo la guarde??? que sea un script de guardado nomas.

Insertar CODE, HTML o PHP:
<?php

 
$imagefile = 'unodepiera.jpg';

function icreate($filename)
{
  $isize = getimagesize($filename);
  if ($isize['mime']=='image/jpeg')
    return imagecreatefromjpeg($filename);
  elseif ($isize['mime']=='image/png')
    return imagecreatefrompng($filename);
  /* Add as many formats as you can */
}

function resizeAspectW($image, $width)
{
  $aspect = imagesx($image) / imagesy($image);
  $height = $width / $aspect;
  $new = imageCreateTrueColor($width, $height);

  imagecopyresampled($new, $image, 0, 0, 0, 0, $width, $height, imagesx($image), imagesy($image));
  return $new;
}

function resizeAspectH($image, $height)
{
  $aspect = imagesx($image) / imagesy($image);
  $width = $height * $aspect;
  $new = imageCreateTrueColor($width, $height);

  imagecopyresampled($new, $image, 0, 0, 0, 0, $width, $height, imagesx($image), imagesy($image));
  return $new;
}

$imgh = icreate($imagefile);
$imgr = resizeAspectH($imgh, 570);



header( "Content-type: image/jpeg" );

imagepng($imgr);
$save = "dni.jpg";
chmod($save,0755);
imagejpeg($imgr, $save, 100, NULL);
imagedestroy($imgr);


?>

gracias a todos espero una orientación. Saludos.
 
¿Te sirvió? Únete a la conversación

Con tu cuenta gratis puedes responder, escribirle al autor por mensaje privado y comprar con Saldo retenido: el pago se libera cuando recibes lo acordado.

Toma 30 segundos · vuelves a este tema al terminar
Quitando.
PHP:
header( "Content-type: image/jpeg" );
imagepng($imgr);
 
Atrás
Arriba