Imbo\EventListener\ImageVariations\Storage\Filesystem::getImagePath PHP Method

getImagePath() private method

Get the path to an image
private getImagePath ( string $user, string $imageIdentifier, integer $width = null, boolean $includeFilename = true ) : string
$user string The user which the image belongs to
$imageIdentifier string Image identifier
$width integer Width of the image, in pixels
$includeFilename boolean Whether or not to include the last part of the path (the filename itself)
return string
    private function getImagePath($user, $imageIdentifier, $width = null, $includeFilename = true)
    {
        $userPath = str_pad($user, 3, '0', STR_PAD_LEFT);
        $parts = [$this->params['dataDir'], $userPath[0], $userPath[1], $userPath[2], $user, $imageIdentifier[0], $imageIdentifier[1], $imageIdentifier[2], $imageIdentifier];
        if ($includeFilename) {
            $parts[] = $width;
        }
        return implode(DIRECTORY_SEPARATOR, $parts);
    }