/** * 画像保存 * * CairoのPNG画像を保存します。 * * @param string $filePath 保存画像のファイルパス * @param string $format 画像ファイルのフォーマット * * @return void */ public function save($filePath, $format = 'png') { unset($format); cairo_surface_write_to_png($this->surface, $filePath); $isSaved = file_exists($filePath); $log = array('isSaved' => $isSaved, 'surface' => $this->surface, 'is_res' => is_resource($this->surface), 'file path' => $filePath, 'file_exists' => file_exists($filePath), 'file size' => filesize($filePath)); $this->_log->log('cairo_surface_write_to_png', $log); cairo_surface_destroy($this->surface); }
/** * Saves the scaled image into a file. * * @param string $filename The filename to save to * @param mixed $type ignored * @param mixed $quality ignored * * @return bool|PEAR_Error TRUE on success or PEAR_Error object on error * * @access public */ function save($filename, $type = null, $quality = null) { cairo_surface_write_to_png($this->surface, $filename); $this->free(); return true; }
/** * Finally save image * * @param string $file Destination filename * @return void */ public function render($file) { $this->drawAllTexts(); cairo_surface_write_to_png($this->surface, $file); }