$dimension->fitHeight()

Fits the height by the given value and returns a modified dimension object

  • return ($image)

Example

<?php

$image = $page->image();
$image->dimensions()->fitHeight(300);

echo html::tag('img', array(
  'src'    => $image->url(),
  'width'  => $image->width(),
  'height' => $image->height()
));

?>