imgix / imgix-java

A Java client library for generating URLs with imgix
https://www.imgix.com
BSD 2-Clause "Simplified" License
19 stars 8 forks source link

docs(readme): update readme for custom srcset feat #48

Closed ericdeansanchez closed 4 years ago

ericdeansanchez commented 4 years ago

This PR updates the readme for the custom srcsets feature set.

These changes not only reflect the additional features added, but also try to pin down the semantics of our syntax and documentation**.

Namely, the differentiation between fixed and fluid-width srcsets. We currently construct two types of srcset attributes: those with fixed widths and those with fluid widths.

Fluid-widths vary. A srcset attribute composed of target width pairs is described as fluid because each image candidate string denotes a unique width-described resource.

Fixed-widths are fixed. A srcset attribute composed of pixel density descriptors (ie. 1x, 2x, 3x) is described as fixed-width because width is held constant, while the pixel density descriptors vary.

Prior to this PR, only default fluid-width srcset attributes could be created. Now, they can be created by supplying a list of widths to create_srcset.

Fluid-width sets can also be created by specifying a widths range that begins and ends on specified value;. the tolerance can also be specified resulting in more customizable fluid-width srcsets.

Prior to this PR, there was no way to customize the quality of fixed-width sets. Now, variable quality is enabled by default and can be toggled off by specifying either:

If"q" is supplied, it takes precedence over the default qualities and disable_variable_quality and it is applied to each image candidate string (URL) in the srcset attribute.

Lastly, ensure our examples stay current and correct they are tested in the readme with the remaining tests defined in the TestReadme.java.