Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Created December 10, 2013 11:04
Show Gist options
  • Select an option

  • Save thom4parisot/7888978 to your computer and use it in GitHub Desktop.

Select an option

Save thom4parisot/7888978 to your computer and use it in GitHub Desktop.
Imager.js custom pixel ratio handler
// https://github.com/BBC-News/Imager.js/blob/0.1.0/Imager.js#L277-279
Imager.transforms.pixelRatio = function pixelRatio(ratio){
if (ratio === 1){
return '';
}
if ([1.3, 2].indexOf(ratio) === -1){
ratio = 2;
}
return '-'+ ratio +'x';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment