ID:194513
 
ImageMagick rocks.

Been using it today not only to convert screenshot bmps to gifs, but I decided to try for creating thumbnail images and it's just one extra argument.

You can even draw onto the images if you want, or have borders, or whatever.

Anyway, since the polaris server has it installed and you can shell out to it, you might want to look into it for customizing images on the fly for websites and the like.

Information at:

http://www.simplesystems.org/ImageMagick/

Also, you can download a version for Windows and thus use it there too.

What I'm doing is creating two versions of commands, like so:

setFile(picture)
var/ckey = ckey(owner_key)
var/path = "screenshots/[ckey]"
var/incoming_filename = "incoming_[number]"
filename = "screenshot_[number].gif"
thumbnail_filename = "thumbnail_[number].gif"

// Pre-emptively delete pre-existing files.
fdel("[path]/[filename]")
fdel("[path]/[thumbnail_filename]")

// Write the screenshot to disk.
fcopy(picture, "[path]/[incoming_filename]")

// Convert it to .gif.
var/command
if (DEVELOPMENT)
// Windows
command = "c:\\imagemagick-win2k\\convert screenshots\\[ckey]\\[incoming_filename] gif:screenshots\\[ckey]\\[filename]"
else
// Unix
command = "/usr/local/bin/convert [path]/[incoming_filename] gif:[path]/[filename]"
shell(command)

// Now create a thumbnail version.
if (DEVELOPMENT)
command = "c:\\imagemagick-win2k\\convert -geometry 15%x15%! screenshots\\[ckey]\\[incoming_filename] gif:screenshots\\[ckey]\\[thumbnail_filename]"
else
command = "/usr/local/bin/convert -geometry 15%x15%! [path]/[incoming_filename] gif:[path]/[thumbnail_filename]"
shell(command)

// Remove cruft.
fdel("[path]/[incoming_filename]")