/**
  * Read metadata
  *
  * Returns all image metadata in an array as defined in {@link $properties}.
  *
  * @param string	$f		Image file path
  * @return array
  */
 public static function readMeta($f)
 {
     $o = new self();
     $o->loadFile($f);
     return $o->getMeta();
 }
Example #2
0
 /**
  * @see	\wcf\system\image\adapter\IImageAdapter::overlayImage()
  */
 public function overlayImage($file, $x, $y, $opacity)
 {
     $overlayImage = new self();
     $overlayImage->loadFile($file);
     // fix PNG alpha channel handling
     // see http://php.net/manual/en/function.imagecopymerge.php#92787
     $cut = imagecreatetruecolor($overlayImage->getWidth(), $overlayImage->getHeight());
     imagecopy($cut, $this->image, 0, 0, $x, $y, $overlayImage->getWidth(), $overlayImage->getHeight());
     imagecopy($cut, $overlayImage->image, 0, 0, 0, 0, $overlayImage->getWidth(), $overlayImage->getHeight());
     imagecopymerge($this->image, $cut, $x, $y, 0, 0, $overlayImage->getWidth(), $overlayImage->getHeight(), $opacity * 100);
 }
Example #3
0
 /**
  * Statically load any INI file. IE \Core\INI::Settings()->toArray()
  * @param  type $name
  * @param  type $args
  * @return Config
  */
 public static function __callStatic($name, $args)
 {
     $ini = new self($name);
     if ($ini->getNamespace()["__called"]) {
         return $ini;
     } else {
         $file = Env::getConfigPath() . "/{$name}" . self::EXT;
         if (file_exists($file)) {
             $ini->loadFile($file);
             self::$Config[$ini->namespace]["__called"] = true;
         } else {
             if (!$ini->namespaceExists()) {
                 throw new Exception("Config File '{$file}' doesn't exist");
             }
         }
         return $ini;
     }
 }
Example #4
0
 public static function fromFile($path)
 {
     $me = new self();
     $me->loadFile($path);
     return $me;
 }
Example #5
0
 /**
  * @return String
  */
 public static function createFromFile(File $aFile)
 {
     $aString = new self();
     $aString->loadFile($aFile);
     return $aString;
 }