fit — Crop and resize combined

    Combine cropping and resizing to format image in a smart way. The method will find the best fitting aspect ratio of your given width and height on the current image automatically, cut it out and resize it to the given dimension. You may pass an optional Closure callback as third parameter, to prevent possible upsizing and a custom position of the cutout as fourth parameter.

    The width the image will be resized to after cropping out the best fitting aspect ratio.

    Closure callback defining constraint to prevent unwanted upsizing of the image. See examples below.

    upsize

    public Intervention\Image\Size upsize()

    Set a position where cutout will be positioned. By default the best fitting aspect ration is centered.

    The possible values are:

    • top-left
    • top
    • top-right
    • left
    • center (default)
    • bottom-left
    • bottom
    • bottom-right