Here you go.
To change the image name, change $ in_filename (currently 'source.jpg'). You can also use URLs, although obviously this will be worse.
Change the $ new_height variable to set how much of the bottom you want to crop.
Play with the values $ offset_x, $ offset_y, $ new_width and $ new_height, and you will understand this.
Please let me know that this works. :)
Hope this helps!
<?php $in_filename = 'source.jpg'; list($width, $height) = getimagesize($in_filename); $offset_x = 0; $offset_y = 0; $new_height = $height - 15; $new_width = $width; $image = imagecreatefromjpeg($in_filename); $new_image = imagecreatetruecolor($new_width, $new_height); imagecopy($new_image, $image, 0, 0, $offset_x, $offset_y, $width, $height); header('Content-Type: image/jpeg'); imagejpeg($new_image); ?>
source share