Using the PHP GD library to resize and save images is HELL
I'm writing a script that will upload a file from user input, resize it to a thumbnail and add the two new filenames to a database. However, I cannot for the life of me figure out how to get PHP to detect the image's MIME type and then give it to the header. Here is the code, I've put comments to try and make it as clear as possible: $picture = $_FILES['picture']['name']; /*original file location*/ $file = 'picture/'.$picture.''; /*save thumbnail location*/ $save = 'thumb/tn-'.$picture.''; /*append thumbnail filename with tn-*/ $thumb = 'tn-'.$picture.''; /*get original file size*/ list($width