Escalando imágenes con PHP
Aquí os dejo un script que acabo de hacer para mi propio blog. Se trata de un pequeño script que coge una imagen y la escala al tamaño que se le pase como parámetro.
Uso:
escalar.php?imatge=url imagen&w=ancho&h=alto
Archivo ‘escalar.php’:
< ?php
header(”Content-type: image/jpg”);
$w=$_REQUEST["w"];
$h=$_REQUEST["h"];
$imatge=$_REQUEST["imatge"];
$im=null;
if ( stripos( $imatge, “.gif” ) ) $im = imagecreatefromgif($imatge);
if ( stripos( $imatge, “.jpg” ) ) $im = [...]
May 17th, 2009 by albert
