README.md in imgix-4.0.0 vs README.md in imgix-4.0.1

- old
+ new

@@ -2,30 +2,31 @@ ![imgix logo](https://assets.imgix.net/sdk-imgix-logo.svg) `imgix-rb` is a client library for generating image URLs with [imgix](https://www.imgix.com/). It is tested under Ruby versions `2.3.0`, `2.2.4`, `2.1.8`, `jruby-9.2.11.0`, and `rbx-3.107`. [![Gem Version](https://img.shields.io/gem/v/imgix.svg)](https://rubygems.org/gems/imgix) -[![Build Status](https://travis-ci.org/imgix/imgix-rb.svg?branch=main)](https://travis-ci.org/imgix/imgix-rb) +[![Build Status](https://travis-ci.com/imgix/imgix-rb.svg?branch=main)](https://travis-ci.com/imgix/imgix-rb) ![Downloads](https://img.shields.io/gem/dt/imgix) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/imgix/imgix-rb/blob/main/LICENSE) +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimgix%2Fimgix-rb.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimgix%2Fimgix-rb?ref=badge_shield) --- <!-- /ix-docs-ignore --> - [Installation](#installation) - [Usage](#usage) - [Srcset Generation](#srcset-generation) - - [Fixed image rendering](#fixed-image-rendering) - - [Custom Widths](#custom-widths) - - [Width Tolerance](#width-tolerance) - - [Minimum and Maximum Width Ranges](#minimum-and-maximum-width-ranges) - - [Variable Qualities](#variable-qualities) -- [Multiple Parameters](#multiple-parameters) + * [Fixed image rendering](#fixed-image-rendering) + * [Custom Widths](#custom-widths) + * [Width Tolerance](#width-tolerance) + * [Minimum and Maximum Width Ranges](#minimum-and-maximum-width-ranges) + * [Variable Qualities](#variable-qualities) - [Purge Cache](#purge-cache) - [URL encoding and signed imgix URLs](#url-encoding-and-signed-imgix-urls) - [What is the `ixlib` param on every request?](#what-is-the-ixlib-param-on-every-request) - [Contributing](#contributing) +- [License](#license) ## Installation Add this line to your application's Gemfile: @@ -77,11 +78,11 @@ https://your-subdomain.imgix.net/images/demo.png?w=8192&s=9fbd257c53e770e345ce3412b64a3452 8192w ``` ### Fixed image rendering -In cases where enough information is provided about an image's dimensions, `to_srcset` will instead build a `srcset` that will allow for an image to be served at different resolutions. The parameters taken into consideration when determining if an image is fixed-width are `w`, `h`, and `ar`. By invoking `to_srcset` with either a width **or** the height and aspect ratio (along with `fit=crop`, typically) provided, a different `srcset` will be generated for a fixed-size image instead. +In cases where enough information is provided about an image's dimensions, `to_srcset` will instead build a `srcset` that will allow for an image to be served at different resolutions. The parameters taken into consideration when determining if an image is fixed-width are `w` or `h`. By invoking `to_srcset` with either a width **or** height provided, a different `srcset` will be generated for a fixed-size image instead. ```rb client = Imgix::Client.new(domain: 'your-subdomain.imgix.net', secure_url_token: 'your-token', include_library_param: false) path = client.path('/images/demo.png') @@ -142,15 +143,15 @@ https://testing.imgix.net/image.jpg?w=8192 8192w ``` ### Minimum and Maximum Width Ranges -If the exact number of minimum/maximum physical pixels that an image will need to be rendered at is known, a user can specify them by passing an integer via `min_srcset` and/or `max_srcset` to the `options` keyword parameters: +If the exact number of minimum/maximum physical pixels that an image will need to be rendered at is known, a user can specify them by passing an integer via `min_width` and/or `max_width` to the `options` keyword parameters: ```rb client = Imgix::Client.new(domain: 'testing.imgix.net', include_library_param: false) -client.path('image.jpg').to_srcset(options: { min_srcset: 500, max_srcset: 2000 }) +client.path('image.jpg').to_srcset(options: { min_width: 500, max_width: 2000 }) ``` Will result in a smaller, more tailored srcset. ``` @@ -165,11 +166,11 @@ https://testing.imgix.net/image.jpg?w=1640 1640w, https://testing.imgix.net/image.jpg?w=1902 1902w, https://testing.imgix.net/image.jpg?w=2000 2000w ``` -Remember that browsers will apply a device pixel ratio as a multiplier when selecting which image to download from a `srcset`. For example, even if you know your image will render no larger than 1000px, specifying `options: { max_srcset: 1000 }` will give your users with DPR higher than 1 no choice but to download and render a low-resolution version of the image. Therefore, it is vital to factor in any potential differences when choosing a minimum or maximum range. +Remember that browsers will apply a device pixel ratio as a multiplier when selecting which image to download from a `srcset`. For example, even if you know your image will render no larger than 1000px, specifying `options: { max_width: 1000 }` will give your users with DPR higher than 1 no choice but to download and render a low-resolution version of the image. Therefore, it is vital to factor in any potential differences when choosing a minimum or maximum range. Also please note that according to the [imgix API](https://docs.imgix.com/apis/url/size/w), the maximum renderable image width is 8192 pixels. ### Variable Qualities @@ -221,5 +222,8 @@ ``` ## Contributing See the [contributing guide](Contributing.markdown). + +## License +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimgix%2Fimgix-rb.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimgix%2Fimgix-rb?ref=badge_large)