original_string: protected function getTargetDimensions($width, $height, $originalImagePath)
      {
          $originalDimensions = [$width, $height];
  
          try {
              $dimensions = getimagesize($originalImagePath);
              if (!$dimensions) {
                  return $originalDimensions;
              }
  
              if ($dimensions[0] > $width || $dimensions[1] > $height) {
                  return $originalDimensions;
              }
  
              return $dimensions;
          }
          catch (Exception $ex) {
              return $originalDimensions;
          }
      }
code: protected function getTargetDimensions($width, $height, $originalImagePath)
      {
          $originalDimensions = [$width, $height];
  
          try {
              $dimensions = getimagesize($originalImagePath);
              if (!$dimensions) {
                  return $originalDimensions;
              }
  
              if ($dimensions[0] > $width || $dimensions[1] > $height) {
                  return $originalDimensions;
              }
  
              return $dimensions;
          }
          catch (Exception $ex) {
              return $originalDimensions;
          }
      }
code_tokens: protected function getTargetDimensions ( $ width , $ height , $ originalImagePath ) { $ originalDimensions = [ $ width , $ height ] ; try { $ dimensions = getimagesize ( $ originalImagePath ) ; if ( ! $ dimensions ) { return $ originalDimensions ; } if ( $ dimensions [ 0 ] > $ width || $ dimensions [ 1 ] > $ height ) { return $ originalDimensions ; } return $ dimensions ; } catch ( Exception $ ex ) { return $ originalDimensions ; } }
docstring: Get target dimensions
  @param int $width
  @param int $height
  @param string $originalImagePath
  @return void
docstring_tokens: Get target dimensions