などのURLで画像のサイズを変更したいのですがlocalhost/changimage.php?percent=40
。私はすでにphpでサイズを変更しました。しかし、ユーザーはここにURLを入力してサイズを変更する必要があります。これが私のPHPコードです。changimage.php
<?php
$filename = '/var/www/html/zahir/images/bike.jpeg';
$percent = 0.5;
header('Content-type: image/jpeg');
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename)
;
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, null, 100);
?>
URLでどうやってやるのかわからない。