Reputation: 1312
I have a large image I want to resize while keeping the proportions
Upvotes: 1
Views: 3197
Reputation: 360802
$blob = mysql_fetch_...();
$gd = imagecreatefromstring($blob);
$resized = imagecreatetruecolor(X, Y); // new image dimensions
imagecopyresampled(....);
ob_start();
imagejpeg($resized);
$new_blob = ob_get_clean();
mysql_query(... update table ...);
Upvotes: 3
Reputation: 3722
There are innumerable image resize scripts out there (google keywords: php thumbnailer). Alternatively roll your own using GD. Load the blob into a string, and use the imagecreatefromstring() function to create the image.
Upvotes: 0