code: protected function followResizeInstructions($imagePath, $resize)
      {
          if (is_object($imagePath)) {
              $image = $imagePath;
          } else {
              $imagine = Image::getImagine();
              $image = $imagine->open($imagePath);
          }
          if (!$image) {
              return false;
          }
          $size = $image->getSize();
          if (isset($resize['width']) && $resize['width'] < $size->getWidth()) {
              $image->resize($size->widen($resize['width']));
          }
          if (isset($resize['height']) && $resize['height'] < $size->getHeight()) {
              $image->resize($size->heighten($resize['height']));
          }
  
          return $image;
      }
docs: [[@doctodo method_description:followResizeInstructions]].
  
  @param [[@doctodo param_type:imagePath]] $imagePath [[@doctodo param_description:imagePath]]
  @param [[@doctodo param_type:resize]]    $resize    [[@doctodo param_description:resize]]
  
  @return [[@doctodo return_type:followResizeInstructions]] [[@doctodo return_description:followResizeInstructions]]