2020-05-02 / 5531阅 / 悠然
Warning: This function has been deprecated. Use wp_get_image_editor() instead.
Scale down an image to fit a particular size and save a new copy of the image.
The PNG transparency will be preserved using the function, as well as the image type. If the file going in is PNG, then the resized image is going to be PNG. The id="see-also" tabindex="-1">See also See also
Top ↑
(string)
(Required)
Image file path.
(int)
(Required)
Maximum width to resize to.
(int)
(Required)
Maximum height to resize to.
(bool)
(Optional)
Whether to crop image or resize.
Default value: false
(string)
(Optional)
File suffix.
Default value: null
(string)
(Optional)
New image file path.
Default value: null
(int)
(Optional)
Image quality percentage.
Default value: 90
(mixed) WP_Error on failure. String with new destination path.