original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: 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
docstring_tokens: Create a new image based on an image preset .