kennygadams
Programmer
Hi,
I just need help with choosing the area where I want the image saved.
How do I save the resized image here $full_base_path_to_the_image_destination?
Thanks in advance for the help.
Kenny
I just need help with choosing the area where I want the image saved.
How do I save the resized image here $full_base_path_to_the_image_destination?
Code:
$image_number = "0003-0702-2520-0121";
$full_base_path_to_the_image_source = ".../cgi-bin/_ORIGINAL/$image_number.jpg";
$full_base_path_to_the_image_destination = ".../pics_test/{$image_number}_TEST.jpg";
// Set a maximum height and width
$destination_W = "300";
$destination_H = "300";
// Get source W and H
list($source_W, $source_H) = getimagesize($full_base_path_to_the_image_source);
// Resample
$image_dest = imagecreatetruecolor($destination_W, $destination_H);
$image_sour = imagecreatefromjpeg($full_base_path_to_the_image_source);
imagecopyresampled($image_dest, $image_sour, 0, 0, 0, 0, $destination_W, $destination_H, $source_W, $source_H);
// Output
imagejpeg($image_dest, null, 100);
Thanks in advance for the help.
Kenny