public Image::scale($width, $height = NULL, $upscale = FALSE)
Scales an image while maintaining aspect ratio.
The resulting image can be smaller for one or both target dimensions.
int|null $width: The target width, in pixels. If this value is null then the scaling will be based only on the height value.
int|null $height: (optional) The target height, in pixels. If this value is null then the scaling will be based only on the width value.
bool $upscale: (optional) Boolean indicating that files smaller than the dimensions will be scaled up. This generally results in a low quality image.
bool TRUE on success, FALSE on failure.
Overrides ImageInterface::scale
public function scale($width, $height = NULL, $upscale = FALSE) { return $this->apply('scale', array('width' => $width, 'height' => $height, 'upscale' => $upscale)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Image!Image.php/function/Image::scale/8.1.x