Pageimage::maxSize() method

Return an image no larger than the given width and height


// basic usage
$pageimage = $pageimage->maxSize(int $width, int $height);

// usage with all arguments
$pageimage = $pageimage->maxSize(int $width, int $height, array $options = []);



Max allowed width


Max allowed height

options (optional)array

See Pageimage::size() method for options, or these additional options:

  • allowOriginal (bool): Allow original image to be returned if already within max requested dimensions? (default=false)

Return value

Pageimage methods and properties

API reference based on ProcessWire core version 3.0.200

Twitter updates

  • Introduction to an invoice application profile being built in ProcessWire: More
    30 September 2022
  • Stumbling upon a really nice ProcessWire-powered website, plus core updates including API improvements for ProcessWire forms— More
    9 September 2022
  • Useful new dot-and-bracket syntax options added for page.get() method— More
    2 September 2022

Latest news

  • ProcessWire Weekly #438
    In the 348th issue of ProcessWire Weekly we're going to cover the latest weekly update from Ryan, take a closer look at a couple of new third party modules, and more. Read on! / 1 October 2022
  • Multi-language field translation export/import
    In this post we cover the details of a new module that enables export and import capabilities for multi-language fields in ProcessWire.
    Blog / 5 August 2022
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.