Calls the driver's public urlBlankAvatar method

@param int   $iWidth  The width of the placeholder
@param int   $iHeight The height of the placeholder
@param mixed $sex     The gender of the blank avatar to show

@return  string
508117
public function urlBlankAvatar($iWidth = 100, $iHeight = 100, $sex = '')
    {
        if (!$this->isPermittedDimension($iWidth, $iHeight)) {
            throw new PermittedDimensionException(
                'CDN::urlBlankAvatar() - Transformation of image to ' . $iWidth . 'x' . $iHeight . ' is not permitted'
            );
        }

        // --------------------------------------------------------------------------

        return $this->callDriver('urlBlankAvatar', [$iWidth, $iHeight, $sex]);
    }
442982
public function ThumbnailURL($width, $height)
    {
        $object = $this->getObjectLatestVersion();
        if ($object instanceof Thumbnail) {
            return $object->ThumbnailURL($width, $height);
        }
        return null;
    }
525298
private static function getNthTokenWithoutWhitespace($tokens, $i) {
		$j = 0;
		foreach ($tokens as $token) {
			if ($token['token'] == 'T_WHITESPACE') {
				continue;
			}
			if ($i == $j) {
				return $token;
			}
			$j++;
		}
		return null;
	}
1053227
protected function getImage($keyImg, $sizeW, $sizeH = false)
    {
        $sizeH = ($sizeH) ? $sizeH : $sizeW;
        // fetch local avatar from meta and make sure it's properly ste
        $local_avatars = get_user_meta($this->ID, $keyImg, true);
        if (empty($local_avatars['full'])) {
            return '';
        }
        // generate a new size
        if (!array_key_exists($sizeW, $local_avatars)) {
            $local_avatars[$sizeW] = $local_avatars['full']; // just in case of failure elsewhere
            $upload_path = wp_upload_dir();
            // get path for image by converting URL, unless its already been set, thanks to using
            // media library approach
            if (!isset($avatar_full_path)) {
                $avatar_full_path = str_replace($upload_path['baseurl'], $upload_path['basedir'],
                    $local_avatars['full']);
            }
            // generate the new size
            $editor = wp_get_image_editor($avatar_full_path);
            if (!is_wp_error($editor)) {
                $resized = $editor->resize($sizeW, $sizeH, true);
                if (!is_wp_error($resized)) {
                    $dest_file = $editor->generate_filename();
                    $saved = $editor->save($dest_file);
                    if (!is_wp_error($saved)) {
                        $local_avatars[$sizeW] = str_replace($upload_path['basedir'], $upload_path['baseurl'],
                            $dest_file);
                    }
                }
            }
            // save updated avatar sizes
            update_user_meta($user_id, $keyImg, $local_avatars);
        }
        if ('http' != substr($local_avatars[$sizeW], 0, 4)) {
            $local_avatars[$sizeW] = home_url($local_avatars[$sizeW]);
        }
        return esc_url($local_avatars[$sizeW]);
    }
902715
public static function url($identifier, $data = null, $domain = null) {

		if(false === is_string($identifier)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($identifier)), E_USER_ERROR);
		}

		if(false === static :: routeExists($identifier)) {
			return trigger_error(sprintf('Route identifier "%s" not found in routes.php', $identifier), E_USER_ERROR);
		}

		if(null !== $data && false === is_string($data) && false === is_array($data)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type array or string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		if(null !== $domain && false === is_string($domain)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($domain)), E_USER_ERROR);
		}

		if(true === is_string($data)) {
			$data = [$data];
		}

		if(null === $data) {
			$data = [];
		}

		$route 		= static :: getRoute($identifier);
		$url 		= $route -> getUrl();
		$parameters = 0;
		$optionals  = 0;

		if(preg_match_all('#\{(.*?)(\?)?\}#i', $url, $matches)) {
			
			foreach($matches[2] as $optional) {

				if('?' === $optional) {

					$optionals++;
					continue;
				}
				
				$parameters++;
			}

			if(count($data) < $parameters) {
				return trigger_error(sprintf('Incorrect number of parameters given for Router url with identifier "%s". Expecting %s, got %s with %s optional', $route -> getIdentifier(), count($matches[2]), count($data), $optionals), E_USER_ERROR);
			}

			foreach($matches[0] as $index => $match) {
				
				$match 		= $matches[0][$index];
				$type 		= $matches[1][$index];
				$optional 	= $matches[2][$index];
				$where 		= $route -> getWhere();
				$replace 	= static :: $types['string'];

				if(true === isset(static :: $types[$type])) {
					$replace = static :: $types[$type];
				}

				if(true === is_array($where)) {
						
					foreach($where as $key => $regex) {
						
						if($key === $type) {

							$replace =$regex;
							break;
						}
					}
				}

				if(true === isset($data[$index])) {

					if(false === is_string($data[$index]) && false === is_numeric($data[$index])) {
						return trigger_error(sprintf('Router url width id "%s" expects parameters to be a String', $route -> getIdentifier()));
					}

					if(preg_match('#' . $replace . '#i', $data[$index])) {
						$url = preg_replace('#'. preg_quote($match) .'#i', $data[$index], $url, 1);
					}
					else {
						return trigger_error(sprintf('Parameters given to router url width id "%s" do not match. Trying to match regular expression pattern "%s" with "%s" as subject', $route -> getIdentifier(), $replace, $data[$index]));
					}
				}
				elseif('' !== $optional) {
					$url = preg_replace('#'. '/?' . preg_quote($match) .'#i', '', $url, 1);
				}
			}
		}

		if(null !== $domain && false === static :: domainExists($domain)) {
			return trigger_error(sprintf('Domain "%s" does not exists in routes.php', $domain), E_USER_ERROR);
		}

		//Check if routes has a prefix and add it if it does
		$prefix = $route -> getPrefix();

		if(true === isset($prefix['url'])) {
			$url = $prefix['url'] . $url;
		}

		return (null !== $domain ? rtrim($domain, '/') . '/' : '') . $url;
	}
1219283
public function save($sString, $sPath, $iWidth = null, $iHeight = null)
    {
        $rImg = $this->generateBarcode($sString, $iWidth, $iHeight);

        if ($rImg) {

            imagepng($rImg, $sPath);
            imagedestroy($rImg);

            return true;

        } else {

            return false;
        }
    }
816158
public function cropFromCenter($cropWidth, $cropHeight = null)
    {
        if (!is_numeric($cropWidth)) {
            throw new \InvalidArgumentException('$cropWidth must be numeric');
        }

        if ($cropHeight !== null && !is_numeric($cropHeight)) {
            throw new \InvalidArgumentException('$cropHeight must be numeric');
        }

        if ($cropHeight === null) {
            $cropHeight = $cropWidth;
        }

        $cropWidth = ($this->currentDimensions['width'] < $cropWidth) ? $this->currentDimensions['width'] : $cropWidth;
        $cropHeight = ($this->currentDimensions['height'] < $cropHeight) ? $this->currentDimensions['height'] : $cropHeight;

        $cropX = intval(($this->currentDimensions['width'] - $cropWidth) / 2);
        $cropY = intval(($this->currentDimensions['height'] - $cropHeight) / 2);

        $this->crop($cropX, $cropY, $cropWidth, $cropHeight);

        return $this;
    }
920886
protected function getDimensions($newWidth, $newHeight)
    {
        $usedRatio = $widthRatio = $this->width / $newWidth;
        $heightRatio = $this->height / $newHeight;

        if ($heightRatio < $widthRatio) {
            $usedRatio = $heightRatio;
        }

        $height = $this->height / $usedRatio;
        $width = $this->width / $usedRatio;

        return [$width, $height];
    }
1212544
public function urlAvatar($iUserId = null, $iWidth = 100, $iHeight = 100)
    {
        if (is_null($iUserId)) {
            $iUserId = activeUser('id');
        }

        if (empty($iUserId)) {
            $avatarUrl = $this->urlBlankAvatar($iWidth, $iHeight);
        } else {
            $oUserModel = Factory::model('User', 'nails/module-auth');
            $user       = $oUserModel->getById($iUserId);
            if (empty($user)) {
                $avatarUrl = $this->urlBlankAvatar($iWidth, $iHeight);
            } elseif (empty($user->profile_img)) {
                $avatarUrl = $this->urlBlankAvatar($iWidth, $iHeight, $user->gender);
            } else {
                $avatarUrl = $this->urlCrop($user->profile_img, $iWidth, $iHeight);
            }
        }

        return $avatarUrl;
    }
785377
public static function getVideoEmbed($url, $width = 560, $height = 315)
    {
        switch (true) {
            case preg_match('/youtu/i', $url):

                $id = self::getVideoId($url);

                if (!$id) {
                    return '<iframe width="' . $width . '" height="' . $height . '" src="//www.youtube.com/embed/' . $id . '?rel=0" frameborder="0" allowfullscreen></iframe>';
                }

                return false;

            case preg_match('/vimeo/i', $url):

                $id = self::getVideoId($url);

                if (!$id) {
                    return '<iframe src="//player.vimeo.com/video/' . $id . '?portrait=0" width="' . $width . '" height="' . $height . '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
                }

                return false;

            case preg_match('/dailymotion/i', $url):

                $id = self::getVideoId($url);

                if (!$id) {
                    return '<iframe frameborder="0" width="' . $width . '" height="' . $height . '" src="//www.dailymotion.com/embed/video/' . $id . '"></iframe>';
                }

                return false;
        }
    }
1203088
public function thumb($thumbWidth, $thumbHeight, $isCut = true, $cutPlace = 5, $quality = 95, $thumbType = 'jpg') 
    {
        if (!in_array($thumbType, ['jpg', 'png', 'webp'])) {
            throw new Exception('thumb image type must be webp|jpg|png');
        }
	
        if($isCut) {
            return $this->thumbCutOut($thumbWidth, $thumbHeight, $cutPlace, $quality, $thumbType);
        } else {
            return $this->thumbUnCut($thumbWidth, $thumbHeight, $quality, $thumbType);
        }
    }
1345221
public function image($title = '', $text = '', $imageUrl, $imageWidth = 400, $imageHeight = 200, $imageAlt = '')
    {
        // $this->alert($title, $text, 'error');
        $this->config['title'] = $title;
        $this->config['text'] = $text;
        $this->config['imageUrl'] = $imageUrl;
        $this->config['imageWidth'] = $imageWidth;
        $this->config['imageHeight'] = $imageHeight;
        if(!is_null($imageAlt)){
            $this->config['imageAlt'] = $imageAlt;
        }else{
            $this->config['imageAlt'] = $title;
        }
        $this->config['animation'] = false;

        $this->flash();

        return $this;
    }
1283221
public function getNameAt($i)
    {
        $fields = $this->getNames();
        if($i<$this->length())
        {
            return $fields[$i];
        }
        return null;
    }
44165
public function image(String $src, Int $width = NULL, Int $height = NULL, Array $attributes = []) : String
    {
        if( ! IS::url($src) )
        {
            $src = Request::getBaseURL($src);
        }

        $attributes['src'] = $src;

        if( ! empty($width) )
        {
            $attributes['width'] = $width;
        }

        if( ! empty($height) )
        {
            $attributes['height'] = $height;
        }

        if( ! isset($attributes['title']) )
        {
            $attributes['title'] = '';
        }

        if( ! isset($attributes['alt']) )
        {
            $attributes['alt'] = '';
        }

        return $this->_singleElement('img', $attributes);
    }
847538
public function getAvatar($uid, $size = 'big', $type = 'virtual')
    {
        $size = in_array(strtolower($size), ['big', 'middle', 'small']) ? strtolower($size) : 'big';
        $type = in_array(strtolower($type), ['real', 'virtual']) ? strtolower($type) : 'virtual';
        return $this->config['api'] . sprintf("/avatar.php?uid=%d&type=%ss&size=%s", $uid, $type, $size);
    }
387245
public function i25($xpos, $ypos, $code, $basewidth = 1, $height = 10)
    {
        $code = (strlen($code)%2 != 0 ? '0' : '') . $code;
        $wide = $basewidth;
        $narrow = $basewidth/3;

        $barChar = array();
        // wide/narrow codes for the digits
        $barChar['0'] = 'nnwwn';
        $barChar['1'] = 'wnnnw';
        $barChar['2'] = 'nwnnw';
        $barChar['3'] = 'wwnnn';
        $barChar['4'] = 'nnwnw';
        $barChar['5'] = 'wnwnn';
        $barChar['6'] = 'nwwnn';
        $barChar['7'] = 'nnnww';
        $barChar['8'] = 'wnnwn';
        $barChar['9'] = 'nwnwn';
        $barChar['A'] = 'nn';
        $barChar['Z'] = 'wn';

        $this->SetFont('Arial', '', 10);
        $this->SetFillColor(0);

        // add start and stop codes
        $code = 'AA' . strtolower($code) . 'ZA';

        for ($i = 0; $i < strlen($code); $i = $i + 2) {
            // choose next pair of digits
            $charBar = $code[$i];
            $charSpace = $code[$i + 1];
            // check whether it is a valid digit
            if (!isset($barChar[$charBar])) {
                $this->Error('Invalid character in barcode: ' . $charBar);
            }
            if (!isset($barChar[$charSpace])) {
                $this->Error('Invalid character in barcode: ' . $charSpace);
            }
            // create a wide/narrow-sequence (first digit=bars, second digit=spaces)
            $seq = '';
            for ($s = 0; $s < strlen($barChar[$charBar]); $s++) {
                $seq .= $barChar[$charBar][$s] . $barChar[$charSpace][$s];
            }
            for ($bar = 0; $bar < strlen($seq); $bar++) {
                // set lineWidth depending on value
                if ($seq[$bar] == 'n') {
                    $lineWidth = $narrow;
                } else {
                    $lineWidth = $wide;
                }
                // draw every second value, because the second digit of the pair is represented by the spaces
                if ($bar%2 == 0) {
                    $this->Rect($xpos, $ypos, $lineWidth, $height, 'F');
                }
                $xpos += $lineWidth;
            }
        }
    }
472093
public function getDimension($w, $h) {
        $startlength = 4;
        $textlength = 2 * 7;
        $intercharlength = 2;

        $w += $startlength + $textlength + $intercharlength;
        $h += $this->thickness;
        return parent::getDimension($w, $h);
    }