original_string: public function onLoadImageCropPopup()
      {
          $this->abortIfReadOnly();
  
          $path = Input::get('path');
          $path = MediaLibrary::validatePath($path);
          $cropSessionKey = md5(FormHelper::getSessionKey());
          $selectionParams = $this->getSelectionParams();
  
          $urlAndSize = $this->getCropEditImageUrlAndSize($path, $cropSessionKey);
          $width = $urlAndSize['dimensions'][0];
          $height = $urlAndSize['dimensions'][1] ?: 1;
  
          $this->vars['currentSelectionMode'] = $selectionParams['mode'];
          $this->vars['currentSelectionWidth'] = $selectionParams['width'];
          $this->vars['currentSelectionHeight'] = $selectionParams['height'];
          $this->vars['cropSessionKey'] = $cropSessionKey;
          $this->vars['imageUrl'] = $urlAndSize['url'];
          $this->vars['dimensions'] = $urlAndSize['dimensions'];
          $this->vars['originalRatio'] = round($width / $height, 5);
          $this->vars['path'] = $path;
  
          return $this->makePartial('image-crop-popup-body');
      }
code: public function onLoadImageCropPopup()
      {
          $this->abortIfReadOnly();
  
          $path = Input::get('path');
          $path = MediaLibrary::validatePath($path);
          $cropSessionKey = md5(FormHelper::getSessionKey());
          $selectionParams = $this->getSelectionParams();
  
          $urlAndSize = $this->getCropEditImageUrlAndSize($path, $cropSessionKey);
          $width = $urlAndSize['dimensions'][0];
          $height = $urlAndSize['dimensions'][1] ?: 1;
  
          $this->vars['currentSelectionMode'] = $selectionParams['mode'];
          $this->vars['currentSelectionWidth'] = $selectionParams['width'];
          $this->vars['currentSelectionHeight'] = $selectionParams['height'];
          $this->vars['cropSessionKey'] = $cropSessionKey;
          $this->vars['imageUrl'] = $urlAndSize['url'];
          $this->vars['dimensions'] = $urlAndSize['dimensions'];
          $this->vars['originalRatio'] = round($width / $height, 5);
          $this->vars['path'] = $path;
  
          return $this->makePartial('image-crop-popup-body');
      }
code_tokens: public function onLoadImageCropPopup ( ) { $ this -> abortIfReadOnly ( ) ; $ path = Input :: get ( 'path' ) ; $ path = MediaLibrary :: validatePath ( $ path ) ; $ cropSessionKey = md5 ( FormHelper :: getSessionKey ( ) ) ; $ selectionParams = $ this -> getSelectionParams ( ) ; $ urlAndSize = $ this -> getCropEditImageUrlAndSize ( $ path , $ cropSessionKey ) ; $ width = $ urlAndSize [ 'dimensions' ] [ 0 ] ; $ height = $ urlAndSize [ 'dimensions' ] [ 1 ] ? : 1 ; $ this -> vars [ 'currentSelectionMode' ] = $ selectionParams [ 'mode' ] ; $ this -> vars [ 'currentSelectionWidth' ] = $ selectionParams [ 'width' ] ; $ this -> vars [ 'currentSelectionHeight' ] = $ selectionParams [ 'height' ] ; $ this -> vars [ 'cropSessionKey' ] = $ cropSessionKey ; $ this -> vars [ 'imageUrl' ] = $ urlAndSize [ 'url' ] ; $ this -> vars [ 'dimensions' ] = $ urlAndSize [ 'dimensions' ] ; $ this -> vars [ 'originalRatio' ] = round ( $ width / $ height , 5 ) ; $ this -> vars [ 'path' ] = $ path ; return $ this -> makePartial ( 'image-crop-popup-body' ) ; }
docstring: Load image for cropping AJAX handler
  @return array
docstring_tokens: Load image for cropping AJAX handler