public Intervention\Image\Image heighten(integer $height, [Closure $callback])
Resizes the current image to new height, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
The new height of the image
Closure callback defining constraint to prevent unwanted upsizing of the image. See examples below.
public Intervention\Image\Size upsize()
Keep image from being upsized.
Resized instance of Intervention\Image\Image
// resize image to new height
$img = Image::make('public/foo.jpg')->heighten(100);
// resize image to new height but do not exceed original size
$img = Image::make('public/foo.jpg')->heighten(100, function ($constraint) {
$constraint->upsize();
});
2023-09-08 更新 本文链接:https://upwqy.com/index.php/wiki/info/898.html