original_string: protected function image()
      {
          $locator = Grav::instance()['locator'];
  
          $file = $this->get('filepath');
  
          // Use existing cache folder or if it doesn't exist, create it.
          $cacheDir = $locator->findResource('cache://images', true) ?: $locator->findResource('cache://images', true, true);
  
          // Make sure we free previous image.
          unset($this->image);
  
          $this->image = ImageFile::open($file)
              ->setCacheDir($cacheDir)
              ->setActualCacheDir($cacheDir)
              ->setPrettyName($this->getImagePrettyName());
  
          return $this;
      }
code: protected function image()
      {
          $locator = Grav::instance()['locator'];
  
          $file = $this->get('filepath');
  
          // Use existing cache folder or if it doesn't exist, create it.
          $cacheDir = $locator->findResource('cache://images', true) ?: $locator->findResource('cache://images', true, true);
  
          // Make sure we free previous image.
          unset($this->image);
  
          $this->image = ImageFile::open($file)
              ->setCacheDir($cacheDir)
              ->setActualCacheDir($cacheDir)
              ->setPrettyName($this->getImagePrettyName());
  
          return $this;
      }
code_tokens: protected function image ( ) { $ locator = Grav :: instance ( ) [ 'locator' ] ; $ file = $ this -> get ( 'filepath' ) ; // Use existing cache folder or if it doesn't exist, create it. $ cacheDir = $ locator -> findResource ( 'cache://images' , true ) ? : $ locator -> findResource ( 'cache://images' , true , true ) ; // Make sure we free previous image. unset ( $ this -> image ) ; $ this -> image = ImageFile :: open ( $ file ) -> setCacheDir ( $ cacheDir ) -> setActualCacheDir ( $ cacheDir ) -> setPrettyName ( $ this -> getImagePrettyName ( ) ) ; return $ this ; }
docstring: Gets medium image, resets image manipulation operations.
  
  @return $this
docstring_tokens: Gets medium image resets image manipulation operations .