src/Uploadcare/File.php
public function getPath($postfix = null)
    {
        $url = sprintf('/%s/', $this->uuid);
        if ($this->default_effects) {
            $url = sprintf('%s-/%s', $url, $this->default_effects);
        }
        if ($this->filename && $postfix === null) {
            $postfix = $this->filename;
        }

        $operations = array();

        foreach ($this->operations as $i => $operation_item) {
            $part = array();
            foreach (array_keys($operation_item) as $operation_type) {
                $operation_params = $operation_item[$operation_type];
                $part[] = $operation_type;

                switch ($operation_type) {
                    case 'crop':
                        $part = $this->__addPartSize($part, $operation_params);
                        $part = $this->__addPartCenter($part, $operation_params);
                        $part = $this->__addPartFillColor($part, $operation_params);
                        break;
                    case 'resize':
                        $part = $this->__addPartSize($part, $operation_params);
                        break;
                    case 'scale_crop':
                        $part = $this->__addPartSize($part, $operation_params);
                        $part = $this->__addPartCenter($part, $operation_params);
                        break;
                    case 'effect':
                        $part = $this->__addPartEffect($part, $operation_params);
                        break;
                    case 'preview':
                        $part = $this->__addPartSize($part, $operation_params);
                        break;
                    case 'custom':
                        $part = array($operation_params);
                        break;
                }
                $part_str = join('/', $part);
                $operations[] = $part_str;
            }
        }

        if (count($operations)) {
            $operations_part = join('/-/', $operations);
            return $url.'-/'.$operations_part.'/'.$postfix;
        } else {
            return $url.$postfix;
        }
    }
public function getPath($postfix = null)
    {
        $url = sprintf('/%s/', $this->uuid);
        if ($this->default_effects) {
            $url = sprintf('%s-/%s', $url, $this->default_effects);
        }
        if ($this->filename && $postfix === null) {
            $postfix = $this->filename;
        }

        $operations = array();

        foreach ($this->operations as $i => $operation_item) {
            $part = array();
            foreach (array_keys($operation_item) as $operation_type) {
                $operation_params = $operation_item[$operation_type];
                $part[] = $operation_type;

                switch ($operation_type) {
                    case 'crop':
                        $part = $this->__addPartSize($part, $operation_params);
                        $part = $this->__addPartCenter($part, $operation_params);
                        $part = $this->__addPartFillColor($part, $operation_params);
                        break;
                    case 'resize':
                        $part = $this->__addPartSize($part, $operation_params);
                        break;
                    case 'scale_crop':
                        $part = $this->__addPartSize($part, $operation_params);
                        $part = $this->__addPartCenter($part, $operation_params);
                        break;
                    case 'effect':
                        $part = $this->__addPartEffect($part, $operation_params);
                        break;
                    case 'preview':
                        $part = $this->__addPartSize($part, $operation_params);
                        break;
                    case 'custom':
                        $part = array($operation_params);
                        break;
                }
                $part_str = join('/', $part);
                $operations[] = $part_str;
            }
        }

        if (count($operations)) {
            $operations_part = join('/-/', $operations);
            return $url.'-/'.$operations_part.'/'.$postfix;
        } else {
            return $url.$postfix;
        }
    }
public function getPath ( $ postfix = null ) { $ url = sprintf ( '/%s/' , $ this -> uuid ) ; if ( $ this -> default_effects ) { $ url = sprintf ( '%s-/%s' , $ url , $ this -> default_effects ) ; } if ( $ this -> filename && $ postfix === null ) { $ postfix = $ this -> filename ; } $ operations = array ( ) ; foreach ( $ this -> operations as $ i => $ operation_item ) { $ part = array ( ) ; foreach ( array_keys ( $ operation_item ) as $ operation_type ) { $ operation_params = $ operation_item [ $ operation_type ] ; $ part [ ] = $ operation_type ; switch ( $ operation_type ) { case 'crop' : $ part = $ this -> __addPartSize ( $ part , $ operation_params ) ; $ part = $ this -> __addPartCenter ( $ part , $ operation_params ) ; $ part = $ this -> __addPartFillColor ( $ part , $ operation_params ) ; break ; case 'resize' : $ part = $ this -> __addPartSize ( $ part , $ operation_params ) ; break ; case 'scale_crop' : $ part = $ this -> __addPartSize ( $ part , $ operation_params ) ; $ part = $ this -> __addPartCenter ( $ part , $ operation_params ) ; break ; case 'effect' : $ part = $ this -> __addPartEffect ( $ part , $ operation_params ) ; break ; case 'preview' : $ part = $ this -> __addPartSize ( $ part , $ operation_params ) ; break ; case 'custom' : $ part = array ( $ operation_params ) ; break ; } $ part_str = join ( '/' , $ part ) ; $ operations [ ] = $ part_str ; } } if ( count ( $ operations ) ) { $ operations_part = join ( '/-/' , $ operations ) ; return $ url . '-/' . $ operations_part . '/' . $ postfix ; } else { return $ url . $ postfix ; } }
Get local URL path of original image

@param string $postfix
@return string
Get local URL path of original image