Public feed #601444

Mine

public text v1 · immutable
Raw Edit
·published 2007-07-03 14:42 UTC
rendered paste body
<?php

$filename = 'test.jpg';
list($width, $height) = getimagesize($filename);

$n_img = imagecreatetruecolor(100, 100);
$img = imagecreatefromjpeg($filename);
imagecopyresampled($n_img, $img, 0, 0, 0, 0, 100, 100, $width, $height);

header('Content-type: image/jpeg');
imagejpeg($n_img);

?>