original_string: public function resampleImage()
      {
          $extension = strtolower($this->owner->getExtension());
  
          if($this->owner->getHeight() > $this->getMaxX() || $this->owner->getWidth() > $this->getMaxY()) {
              $original = $this->owner->getFullPath();
              $resampled = $original. '.tmp.'. $extension;
  
              $gd = new GD($original);
  
              if($gd->hasImageResource()) {
                  $gd = $gd->resizeRatio($this->getMaxX(), $this->getMaxY());
  
                  if($gd) {
                      $gd->writeTo($resampled);
                      unlink($original);
                      rename($resampled, $original);
                  }
              }
          }
      }
code: public function resampleImage()
      {
          $extension = strtolower($this->owner->getExtension());
  
          if($this->owner->getHeight() > $this->getMaxX() || $this->owner->getWidth() > $this->getMaxY()) {
              $original = $this->owner->getFullPath();
              $resampled = $original. '.tmp.'. $extension;
  
              $gd = new GD($original);
  
              if($gd->hasImageResource()) {
                  $gd = $gd->resizeRatio($this->getMaxX(), $this->getMaxY());
  
                  if($gd) {
                      $gd->writeTo($resampled);
                      unlink($original);
                      rename($resampled, $original);
                  }
              }
          }
      }
code_tokens: public function resampleImage ( ) { $ extension = strtolower ( $ this -> owner -> getExtension ( ) ) ; if ( $ this -> owner -> getHeight ( ) > $ this -> getMaxX ( ) || $ this -> owner -> getWidth ( ) > $ this -> getMaxY ( ) ) { $ original = $ this -> owner -> getFullPath ( ) ; $ resampled = $ original . '.tmp.' . $ extension ; $ gd = new GD ( $ original ) ; if ( $ gd -> hasImageResource ( ) ) { $ gd = $ gd -> resizeRatio ( $ this -> getMaxX ( ) , $ this -> getMaxY ( ) ) ; if ( $ gd ) { $ gd -> writeTo ( $ resampled ) ; unlink ( $ original ) ; rename ( $ resampled , $ original ) ; } } } }
docstring: Resamples the image to the maximum Height and Width
docstring_tokens: Resamples the image to the maximum Height and Width