WP_Image_Editor_GD::crop

SummerySummery

Crops Image.

Syntax

WP_Image_Editor_GD::crop( int $src_x, int $src_y, int $src_w, int $src_h, int $dst_w = null, int $dst_h = null, bool $src_abs = false )

ParametersParameters

$src_x

(int) (Required) The start x position to crop from.

$src_y

(int) (Required) The start y position to crop from.

$src_w

(int) (Required) The width to crop.

$src_h

(int) (Required) The height to crop.

$dst_w

(int) (Optional) The destination width.

Default value: null

$dst_h

(int) (Optional) The destination height.

Default value: null

$src_abs

(bool) (Optional) If the source crop points are absolute.

Default value: false

ReturnReturn

(bool|WP_Error)

SourceSource

File: wp-includes/class-wp-image-editor-gd.php


			

ChangelogChangelog

Changelog
Version Description
3.5.0 Introduced.
Scroll to Top