I quickly wrote this script to help out a web hosting client whose developer was insisting I install ImageMagik on our server. It allows you to put up resized versions of jpegs without going through the fuss of working on them with a graphics editor. There are three functions: image_resize allows you to specify a new width and height for an image. image_horizontal_resize and image_vertical_resize are wrappers for the first and allow you to specify only the width or the height. The last parameter in these functions is a boolean, and determines if the original image is made available for download or not.

To use the functions, save the script to a file called jpg-resize.php. If you decide to call it something else, don't forget to change the beginning of $src variable in the image_resize function. Include the script at the beginning of your php files <? include("jpg-resize.php"); ?> and call the function from wherever you want to place an image.