Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

imagejpeg Help 1

Status
Not open for further replies.

kennygadams

Programmer
Jan 2, 2005
94
US
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?

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
 
That would be where you have null in your call to imagejpeg.

so:

Code:
imagejpeg($image_dest,[red]$full_base_path_to_the_image_destination[/red] , 100);

The PHP online manual is your friend. Use it:[blue]imagejpeg()[/blue]


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top