function __construct($image, $options = array())
{
$this->root = c::get('thumb.cache.root', c::get('root') . '/thumbs');
$this->url = c::get('thumb.cache.url', c::get('url') . '/thumbs');
if (!$image) {
return false;
}
$this->obj = $image;
// set some values from the image
$this->sourceWidth = $this->obj->width();
$this->sourceHeight = $this->obj->height();
$this->width = $this->sourceWidth;
$this->height = $this->sourceHeight;
$this->source = $this->obj->root();
$this->mime = $this->obj->mime();
// set the max width and height
$this->maxWidth = @$options['width'];
$this->maxHeight = @$options['height'];
// set the quality
$this->crop = @$options['crop'];
// set the quality
$this->quality = a::get($options, 'quality', c::get('thumb.quality', 100));
// set the default upscale behavior
$this->upscale = a::get($options, 'upscale', c::get('thumb.upscale', false));
// set the alt text
$this->alt = a::get($options, 'alt', $this->obj->name());
// set the className text
$this->className = @$options['class'];
// set the new size
$this->size();
// create the thumbnail
$this->create();
}