isSupportedFormat() 공개 정적인 메소드

Check is format supported by lib
public static isSupportedFormat ( string $format ) : boolean
$format string
리턴 boolean
예제 #1
0
파일: Image.php 프로젝트: JBZoo/Image
 /**
  * Save image to file
  *
  * @param string $filename
  * @param int    $quality
  * @return bool
  *
  * @throws Exception
  */
 protected function _save($filename, $quality)
 {
     $quality = $quality ?: $this->_quality;
     $quality = Helper::quality($quality);
     $format = strtolower(FS::ext($filename));
     if (!Helper::isSupportedFormat($format)) {
         $format = $this->_mime;
     }
     $filename = FS::clean($filename);
     // Create the image
     $result = $this->_renderImageByFormat($format, $filename, $quality);
     $this->loadFile($filename);
     $this->_quality = $quality;
     return $result;
 }