Thumbs

Soldato
Joined
26 Dec 2003
Posts
16,520
Location
London
I quite often want to upload some images and then post them on a forum or other medium along with thumbnails. After a while manually generating the thumbnails and manually typing out/copy-paste-alter-ung the URLs gets really annoying, and I typically don't want them in a Gallery so that's out too.

So, I wrote this quick and (very) dirty PHP script. Upload it to the same directory as your images, open it in your browser and Robert's your mother's brother:



(Default is 250x250 with aspect ratio maintained; you can optionally pass `width` and `height` parameters in the URL to have a custom width.)

Hope someone finds it useful!

Download

The smallprint:

You should probably delete the thumbs.php file once you're done, so that people don't generate new thumbs! Use at your own risk don't blame me if it sets of a thermonuclear reaction in your photographs etc.!
 
Last edited:
The problem with determining via mime-type is that not everyone has the mime-type functionality built in—XAMPP doesn't, since I don't have it on my local machine. Determining via extension was just a dirty hack to get things working for me.

While there might be security issues when allowing the public to upload files, for example, that's not an issue here; the exploit, if any, requires FTP or shell access—and if someone has that then there's far worse things they can do.
 
Back
Top Bottom