_image_get_preview_ratio()WP 2.9.0

Image preview ratio. Internal use only.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

float|Int. Image preview ratio.

Usage

_image_get_preview_ratio( $w, $h );
$w(int) (required)
Image width in pixels.
$h(int) (required)
Image height in pixels.

Changelog

Since 2.9.0 Introduced.

_image_get_preview_ratio() code WP 6.5.2

function _image_get_preview_ratio( $w, $h ) {
	$max = max( $w, $h );
	return $max > 600 ? ( 600 / $max ) : 1;
}