首页 WordPress函数大全 image_resize_dimensions()

image_resize_dimensions()

2020-05-02 / 3592阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

image_resize_dimensions( int $orig_w, int $orig_h, int $dest_w, int $dest_h, bool|array $crop = false )

Retrieves calculated resize dimensions for use in WP_Image_Editor.

描述

Calculates dimensions and coordinates for a resized image that fits within a specified width and height.

Cropping behavior is dependent>

参数

$orig_w

(int)
(Required)
Original width in pixels.

$orig_h

(int)
(Required)
Original height in pixels.

$dest_w

(int)
(Required)
New width in pixels.

$dest_h

(int)
(Required)
New height in pixels.

$crop

(bool|array)
(Optional)
Whether to crop image to specified width and height or resize. An array can specify positioning of the crop area.

Default value: false

返回

(array|false) Returned array matches parameters for imagecopyresampled(). False on failure.

大家谈论
    我的见解