public function show($rawData = false)
{
if (headers_sent()) {
throw new RuntimeException('Cannot show image, headers have already been sent');
}
switch ($this->format) {
case 'GIF':
if ($rawData === false) {
header('Content-type: image/gif');
}
imagegif($this->oldImage);
break;
case 'JPG':
if ($rawData === false) {
header('Content-type: image/jpeg');
}
imagejpeg($this->oldImage, null, $this->options['jpegQuality']);
break;
case 'PNG':
case 'STRING':
if ($rawData === false) {
header('Content-type: image/png');
}
imagepng($this->oldImage);
break;
}
return $this;
}