class_PngImage.php
Go to the documentation of this file.00001 <?php
00024 class PngImage extends BaseImage {
00030 protected function __construct () {
00031
00032 parent::__construct(__CLASS__);
00033 }
00034
00041 public final static function createPngImage(CompileableTemplate $templateInstance) {
00042
00043 $imageInstance = new PngImage();
00044
00045
00046 $imageInstance->setTemplateInstance($templateInstance);
00047
00048
00049 $imageInstance->setImageType('png');
00050
00051
00052 return $imageInstance;
00053 }
00054
00060 public function finishImage () {
00061
00062 parent::finishImage();
00063
00064
00065 $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
00066
00067
00068 if (file_exists($cacheFile)) {
00069
00070 @unlink($cacheFile);
00071 }
00072
00073
00074 imagepng($this->getImageResource(), $cacheFile, 9, PNG_ALL_FILTERS);
00075 }
00076 }
00077
00078
00079 ?>