$file->crop($width, $height = null, $quality = null)

Crops the image by width and optionally by height

  • since: Kirby 2.3.0
  • return ($file)

Example

// crop into a square of 300 x 300
echo $page->image()->crop(300);

// crop by height as well
echo $page->image()->crop(300, 200);

// adjust the quality
echo $page->image()->crop(300, 200, 70);