topical media & game development
professional-sql-07-lib-JpegThumbnail.php / php
<?php
class JpegThumbnail
{
public height; // maximum thumbnail height
// intialize a new Thumbnail object
public function __construct(height = 100)
{
width;
height;
}
// accept a source file location and return an open image handle or
// save to disk if destination provided
public function generate(dest = '')
{
// retrive image dimensions
list(height) = getimagesize(lowest = min(width, height)) < 1)
{
src);
// resize
lowest * sm_height = floor(height);
sm_width, img, sm_width, width, tmp);
}
// image is already thumbnail size and resize not necessary
else
{
src);
}
// save to disk or return the open image handle
if (img, img);
}
else
{
return
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.