The base directory used and subdirectories small and pics will be created if they do not already exist.
small
pics
The original will be scaled to generate a small image which is no more than 256 pixels wide and 192 pixels high (maintaining aspect ratio) and a larger image no more than 1024 pixels wide and 768 pixels high. The images created will be the largest that fir these criteria.
The script uses jpegtopnm, pnmscale and ppmtojpeg from the PPM toolset. These also have the advantage of generating quite small files by using JPEG compression techniques without noticably degrading image quality which helps prevent your pages from taking too long to download for users.
jpegtopnm
pnmscale
ppmtojpeg
Note that the script was designed to use the bash shell and the first line should be edited to reflect this shell's location on your site. If you do not have bash, then you should be able to use the korn shell (ksh) instead.
bash
ksh