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:
disableVariableQuality=True, or
by specifying a "q" parameter (i.e. q=75)
If"q" is supplied, it takes precedence over the default qualities anddisable_variable_qualityand 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.
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
andfluid-width
srcsets. We currently construct two types of srcset attributes: those withfixed
widths and those withfluid
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
tocreate_srcset
.Fluid-width sets can also be created by specifying a widths range that
begin
s andend
s on specified value;. thetol
erance 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:
disableVariableQuality=True
, or"q"
parameter (i.e.q=75
)If
"q"
is supplied, it takes precedence over the default qualities anddisable_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
.