Hi again;
I've been looking at the various posts regarding image cropping and not finding any that are dirt-simple enough for me to comprehend.
The best I've been able to do is take a square .jpeg, chop it in half and get a black rectangle in return.
Here is what I need.
Refer to a .jpg file, as is. and chop off the bottom half of it. (leave it the same width), save it to a new file name or overwrite the original file...that would be okay too.
So if I start with:
<?php
$imagejpg = "temp.jpg";
$img_orig = imagecreatefromjpeg($imagejpg);
$Sx = imagesx($img_orig); //varies
$Sy = imagesy($img_orig); //would typically be 30
$Dy=15; //chop off certain number of pixels
//$Dy=($Sy/2); //...or the bottom 50%
//... here is where I'm stuck ...what goes in here?
$img_dest = imagecreatetruecolor($Sx,$Dy);
??? = $_SERVER['DOCUMNET_ROOT'] . "temp_croptest.jpg"; //save the file to the directory
//show that it worked...
echo "<img src=\"temp_croptest.jpg\">";
?>