Is there a simple way of dynamically scaling an image in php?
Id like to specifically use some kind of function where i can insert it into my heml such as
<img src=image.php?img=boss.jpg&width=500>
and of course it would then scale the image to whatever height constrains it to 500px wide
i appreciate all input, thanks.
EDIT does need to include jpg png and gif file types
I prefer WideImage library, because it's really really easy to use.
In your case, everything you have to do is:
$img_path = $_GET['img'];
$new_width = $_GET['width'];
$new_img = wiImage::load($img_path)->resize($new_width);
header('Content-Type: image/jpeg');
echo $new_img->asString('jpg', 80);
And it supports jpeg, png, gif, gd, ...