_image_get_preview_ratio

The timeline below displays how wordpress function _image_get_preview_ratio has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Image preview ratio. Internal use only.
 *
 * @since 2.9.0
 *
 * @ignore
 * @param int $w Image width in pixels.
 * @param int $h Image height in pixels.
 * @return float|int Image preview ratio.
 */
function _image_get_preview_ratio($w, $h)
{
    $max = max($w, $h);
    return ($max > 600) ? 600 / $max : 1;
}

WordPress Version: 4.2

/**
 * Image preview ratio. Internal use only.
 *
 * @since 2.9.0
 *
 * @ignore
 * @param int $w Image width in pixels.
 * @param int $h Image height in pixels.
 * @return float|int Image preview ratio.
 */
function _image_get_preview_ratio($w, $h)
{
    $max = max($w, $h);
    return ($max > 400) ? 400 / $max : 1;
}

WordPress Version: 3.7

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