WordPress开发者和主题制作者的搜索引擎



_rotate_image_resource ›

Since2.9.0
已弃用3.5.0
_rotate_image_resource ( $img, $angle )
参数: (2)
  • (resource) $img Image resource.
    Required: Yes
  • (float|int) $angle Image rotation angle, in degrees.
    Required: Yes
查看:
  • WP_Image_Editor::rotate()
返回:
  • (resource|false) GD image resource, false otherwise.
定义在:
文档:

Returns an image resource. Internal use only.



源码

function _rotate_image_resource( $img, $angle ) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Image_Editor::rotate()' );
	if ( function_exists( 'imagerotate' ) ) {
		$rotated = imagerotate( $img, $angle, 0 );
		if ( is_resource( $rotated ) ) {
			imagedestroy( $img );
			$img = $rotated;
		}
	}
	return $img;
}