bracketedPixelRatio

(require("bracketedPixelRatio"))(dpr) → {number} #

Normalizes a user's device pixel ratio to either 1, 1.5, or 2.

This is important when the server resizes images on the fly in order to reduce the work it has to do for device pixel ratios that deviate from a set of common ratios.

Adapted from mediawiki/core /resources/src/jquery/jquery.hidpi.js

Parameters:

Name Type Attributes Default Description
dpr number optional
window.devicePixelRatio
Source:

Returns:

The bracketed device pixel ratio

Type
number