public function resizeStretch($width, $height, &$that)
{
// bring stuff from the parent class into this class...
$this->parentInstance = $that;
$this->oldImage = $this->parentInstance->getOldImage();
$this->currentDimensions = $this->parentInstance->getCurrentDimensions();
$this->workingImage = $this->parentInstance->getWorkingImage();
$this->options = $this->parentInstance->getOptions();
// make sure our arguments are valid
if (!is_numeric($width)) {
throw new InvalidArgumentException('$maxWidth must be numeric');
}
if (!is_numeric($height)) {
throw new InvalidArgumentException('$maxHeight must be numeric');
}
// get the new dimensions...
$this->newDimensions = array('newWidth' => $width, 'newHeight' => $height);
// create the working image
if (function_exists('imagecreatetruecolor')) {
$this->workingImage = imagecreatetruecolor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
} else {
$this->workingImage = imagecreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);
}
//$this->parentInstance->preserveAlpha();
// and create the newly sized image
imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']);
// update all the variables and resources to be correct
$this->parentInstance->setOldImage($this->workingImage);
$this->parentInstance->setCurrentDimensions($this->newDimensions);
return $that;
}