Example #1
0
 /**
  * Flush the output to the browser. The 'filename' property is inspected to
  * see what file type to use, e.g. PNG or JPEG.
  *
  * \see AnewtImage::flush_png
  * \see AnewtImage::flush_jpeg
  * \see AnewtImage::save
  */
 public function flush()
 {
     assert('$this->is_set("filename")');
     $filename = $this->get('filename');
     if (AnewtImage::_filename_looks_like_png($filename)) {
         $this->flush_png($filename);
     } elseif (AnewtImage::_filename_looks_like_jpeg($filename)) {
         $this->flush_jpeg($this->get('quality'));
     } else {
         trigger_error(sprintf('AnewtImage::save(): Cannot flush image, filename "%s" does not have a supported extension', $filename), E_USER_ERROR);
     }
 }