Module: Imgix
- Defined in:
- lib/imgix.rb,
lib/imgix/path.rb,
lib/imgix/client.rb,
lib/imgix/version.rb,
lib/imgix/param_helpers.rb
Defined Under Namespace
Modules: ParamHelpers Classes: Client, Path
Constant Summary collapse
- DOMAIN_REGEX =
regex pattern used to determine if a domain is valid
/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i- DEFAULT_WIDTH_TOLERANCE =
determines the growth rate when building out srcset pair widths
0.08
- MIN_WIDTH =
the default minimum srcset width
100- MAX_WIDTH =
the default maximum srcset width, also the max width supported by imgix
8192- TARGET_WIDTHS =
returns an array of width values used during scrset generation
lambda { |tolerance, min, max| increment_percentage = tolerance || DEFAULT_WIDTH_TOLERANCE unless increment_percentage.is_a? Numeric and increment_percentage > 0 raise ArgumentError, "The width_tolerance argument must be passed a positive scalar value" end max_size = max || MAX_WIDTH resolutions = [] prev = min || MIN_WIDTH while(prev <= max_size) # ensures that each width is even resolutions.push((2 * (prev / 2).round)) prev *= 1 + (increment_percentage * 2) end resolutions.push(max_size) return resolutions }
- DPR_QUALITY =
hash of default quality parameter values mapped by each dpr srcset entry
{ 1 => 75, 2 => 50, 3 => 35, 4 => 23, 5 => 20 }
- VERSION =
'3.2.0'