-/* $Id: thumb.js,v 1.2 2006/11/05 11:14:56 mmondor Exp $ */
+/* $Id: thumb.js,v 1.3 2006/11/05 11:55:40 mmondor Exp $ */
/*
* Copyright (c) 2006, Matthew Mondor
* - Work on better presentation
*/
+function thumbnail_jpeg(fh)
+{
+ this.jpeg(fh, 50);
+}
+
function thumbnail(from, to, xmax, ymax)
{
var ofh, oimg, ox, oy, timg, tfh;
/* Set load and save functions relative to image file type */
if (from.match(/\.jpg$|\.jpeg$/)) {
GD.load = GD.createFromJpeg;
- GDImage.prototype.save = function(fh) { this.jpeg(fh, 50) };
+ GDImage.prototype.save = thumbnail_jpeg;
} else if (from.match(/\.png$/)) {
GD.load = GD.createFromPng;
GDImage.prototype.save = GDImage.prototype.png;
return ret;
}
-thumbnail_dir('/home/data/jshttpd/mmondor/testimg', 128, 128);
+thumbnail_dir('/home/data/jshttpd/mmondor/testimg', 64, 64);