src/Manager.php
protected function buildImage($actions, Image $image, $dst)
    {
        foreach ($actions as $action) {
            // Make sure the width and height are computed first so they can be used
            // in relative x/yoffsets like 'center' or 'bottom'.
            if (isset($action['width'])) {
                $action['width'] = $this->percent($action['width'], $image->getWidth());
            }

            if (isset($action['height'])) {
                $action['height'] = $this->percent($action['height'], $image->getHeight());
            }

            if (isset($action['xoffset'])) {
                $action['xoffset'] = $this->keywords($action['xoffset'], $image->getWidth(), $action['width']);
            }

            if (isset($action['yoffset'])) {
                $action['yoffset'] = $this->keywords($action['yoffset'], $image->getHeight(), $action['height']);
            }

            $this->getMethodCaller()->call($image, $action['action'], $action);
        }

        return $image->save($dst);
    }
protected function buildImage($actions, Image $image, $dst)
    {
        foreach ($actions as $action) {
            // Make sure the width and height are computed first so they can be used
            // in relative x/yoffsets like 'center' or 'bottom'.
            if (isset($action['width'])) {
                $action['width'] = $this->percent($action['width'], $image->getWidth());
            }

            if (isset($action['height'])) {
                $action['height'] = $this->percent($action['height'], $image->getHeight());
            }

            if (isset($action['xoffset'])) {
                $action['xoffset'] = $this->keywords($action['xoffset'], $image->getWidth(), $action['width']);
            }

            if (isset($action['yoffset'])) {
                $action['yoffset'] = $this->keywords($action['yoffset'], $image->getHeight(), $action['height']);
            }

            $this->getMethodCaller()->call($image, $action['action'], $action);
        }

        return $image->save($dst);
    }
protected function buildImage ( $ actions , Image $ image , $ dst ) { foreach ( $ actions as $ action ) { // Make sure the width and height are computed first so they can be used // in relative x/yoffsets like 'center' or 'bottom'. if ( isset ( $ action [ 'width' ] ) ) { $ action [ 'width' ] = $ this -> percent ( $ action [ 'width' ] , $ image -> getWidth ( ) ) ; } if ( isset ( $ action [ 'height' ] ) ) { $ action [ 'height' ] = $ this -> percent ( $ action [ 'height' ] , $ image -> getHeight ( ) ) ; } if ( isset ( $ action [ 'xoffset' ] ) ) { $ action [ 'xoffset' ] = $ this -> keywords ( $ action [ 'xoffset' ] , $ image -> getWidth ( ) , $ action [ 'width' ] ) ; } if ( isset ( $ action [ 'yoffset' ] ) ) { $ action [ 'yoffset' ] = $ this -> keywords ( $ action [ 'yoffset' ] , $ image -> getHeight ( ) , $ action [ 'height' ] ) ; } $ this -> getMethodCaller ( ) -> call ( $ image , $ action [ 'action' ] , $ action ) ; } return $ image -> save ( $ dst ) ; }
Create a new image based on an image preset.

@param array $actions An image preset array.
@param Image $image Path of the source file.
@param string $dst Path of the destination file.
@throws \RuntimeException
@return Image
Create a new image based on an image preset .