Example #1
0
 public static function createByFileName($fileName)
 {
     $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
     $anyImageType = new self(self::getAnyId());
     $extensionList = $anyImageType->getExtensionList();
     if (isset($extensionList[$ext])) {
         return new self($extensionList[$ext]);
     }
     throw new WrongArgumentException("don't know type for '{$ext}' extension");
 }