imgix/js-core

Allow configure srcSet DPR generation

sylcastaing opened this issue · 3 comments

Hello team,

My company and I want to cap DPR src-set generated by buildSrcSet function. We just need 1x and 2x to reduce DOM size and dowloaded image on mobile.

I think we can have an option maxDPR to cap srcet generation.

Example :

{
  maxDPR: 2
}

Or maybe make targetRatios configurable with option inside the _buildDPRSrcSet fonction.

Example :

{
  targetRatios: [1, 2]
}

Hi @sylcastaing, thanks for the issue! We are currently on a company holiday, so I will aim to get back to you in about two weeks.

Hey @sylcastaing, we are happy to support a targetDPRRatios type feature. Unfortunately we don't have time to implement this soon, so we will put this in our backlog and prioritise it. We will of course also happily accept a PR for this feature!

Resolved as part of #307