public function setOptions($options = array())
{
// make sure we've got an array for $this->options (could be null)
if (!is_array($this->options)) {
$this->options = array();
}
// make sure we've gotten a proper argument
if (!is_array($options)) {
throw new InvalidArgumentException('setOptions requires an array');
}
// we've yet to init the default options, so create them here
if (count($this->options) == 0) {
$defaultOptions = array('resizeUp' => false, 'jpegQuality' => 100, 'correctPermissions' => false, 'preserveAlpha' => true, 'alphaMaskColor' => array(255, 255, 255), 'preserveTransparency' => true, 'transparencyMaskColor' => array(0, 0, 0));
} else {
$defaultOptions = $this->options;
}
$this->options = array_merge($defaultOptions, $options);
}