예제 #1
0
 /**
  * Constructor. Sets up resizable types, extensions, etc.
  *
  * @return	void
  */
 public function __construct($options)
 {
     parent::__construct($options);
     $this->info_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true, 'psd' => true, 'bmp' => true, 'tiff' => true, 'tif' => true);
     $this->thumb_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true);
     $this->resize_types = array('JPEG' => true, 'PNG' => true, 'GIF' => true);
     if (preg_match('~#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})~i', $this->options['thumbcolor'], $match)) {
         $this->thumbcolor = array('r' => hexdec($match[1]), 'g' => hexdec($match[2]), 'b' => hexdec($match[3]));
     }
 }
예제 #2
0
 /**
  * Constructor
  * Sets ImageMagick paths to convert and identify
  *
  * @return	void
  */
 public function __construct($options)
 {
     parent::__construct($options);
     $path = preg_replace('#[/\\\\]+$#', '', $this->options['magickpath']);
     if (preg_match('#^WIN#i', PHP_OS)) {
         $this->identifypath = '"' . $path . '\\identify.exe"';
         $this->convertpath = '"' . $path . '\\convert.exe"';
     } else {
         $this->identifypath = "'" . $path . "/identify'";
         $this->convertpath = "'" . $path . "/convert'";
     }
     $this->must_convert_types = array('PSD' => true, 'BMP' => true, 'TIFF' => true, 'PDF' => true);
     $this->resize_types = array('GIF' => true, 'JPEG' => true, 'PNG' => true, 'BMP' => true, 'TIFF' => true);
     $this->thumb_extensions = array('gif' => true, 'jpg' => true, 'jpe' => true, 'jpeg' => true, 'png' => true, 'psd' => true, 'pdf' => true, 'bmp' => true, 'tiff' => true, 'tif' => true);
     $this->info_extensions =& $this->thumb_extensions;
     if (preg_match('~^#([0-9A-F]{6})$~i', $this->options['thumbcolor'], $match)) {
         $this->thumbcolor = $match[0];
     }
 }