All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
3.5.1 (2021-06-07)
- fix: bump version to match current (a8c6e10)
- fix(sizes): use ix-sizes as sizes fallback if ix-sizes not auto (a6ad5cd)
3.5.0 (2021-05-21)
- sizes: feat: allow for automatic resizing of images via
ix-sizes=auto
(f9a2588)
When set to auto
, automatically updates an img
tag's sizes
attribute to match the image's display size.
<img
ix-src="https://assets.imgix.net/unsplash/hotairballoon.jpg?w=300&h=500&fit=crop&crop=right"
alt="A hot air balloon on a sunny day"
ix-sizes="auto"
>
Please note: the image width has to be calculable before the image has loaded, otherwise
sizes
will not match the width of the displayed image. In most cases, using the CSS ruleimg[ix-sizes="auto"] { display: block; width: 100%; }
will ensure the image'swidth
is calculable before it has loaded.
Generates HTML similar to the following
<img
ix-src="https://assets.imgix.net/unsplash/hotairballoon.jpg?w=300&h=500&fit=crop&crop=right"
alt="A hot air balloon on a sunny day"
ix-sizes="auto"
sizes="200px"
srcset="
https://assets.imgix.net/unsplash/hotairballoon.jpg?w=100&h=167&fit=crop&crop=right 100w,
https://assets.imgix.net/unsplash/hotairballoon.jpg?w=200&h=333&fit=crop&crop=right 200w,
…
https://assets.imgix.net/unsplash/hotairballoon.jpg?w=2560&h=4267&fit=crop&crop=right 2560w
"
src="https://assets.imgix.net/unsplash/hotairballoon.jpg?w=300&h=500&fit=crop&crop=right"
ix-initialized="ix-initialized"
>
When using ix-sizes="auto"
, the browser will not have the sizes
attribute to reference on first render but only after imgix.js
has loaded. This is why it's recommended to manually set sizes
whenever possible.
- imgixtag: fix issue where sizes was set to null & use ix-sizes (0cd9b17)
- shim rIC for older browsers (cb1b4b7)
- small error (e61bf23)
3.4.2 (2019-12-09)
- fix: skip over tags that fail validations (#175)
3.4.1 (2019-05-24)
- global default parameters (#134) (ab42f74), closes #129
- use exponential increase for srcset widths (#130) (d18a85f)
- Fixed a bug that was adding an unintended extra query parameter to URLs generated from an
ix-src
attribute with no base parameters. For full details, see PR #128.
- Fixed an issue where some browsers with a fractional window.devicePixelRatio value would chunder errors into the browser console.
- The following configuration options can now be set to
null
, which will prevent the corresponding output attribute from being set on elements processed by imgix.js:srcAttribute
srcsetAttribute
sizesAttribute
- The following configuration options have been made global, and thus can be set using
<meta property="ix:foo"/>
tags or by updating theimgix.config
object:srcAttribute
srcsetAttribute
sizesAttribute
srcInputAttribute
pathInputAttribute
paramsInputAttribute
hostInputAttribute
- Any global configuration options can be overridden by providing an options object when calling
imgix.init()
- Automatic initialization of
<img>
and<source>
tags can be disabled by including<meta property="ix:autoInit" content="false">
in the document's<head>
.
- Values for base-64 parameters provided in the
ix-src
attribute will no longer be automatically encoded. For complete notes about this change, see PR #114.
- Allow customization of the attributes used to define images. See the readme for details: https://github.com/imgix/imgix.js#custom-input-attributes.
- Properly encode Base64 variant params from
ix-src
.
- Fixes an issue in browsers without the
window.devicePixelRatio
property.
- Adds the
ixlib
diagnostic parameter, and associatedimgix.config.includeLibraryParam
option. - The current library version number is now accessible under
imgix.VERSION
.
- This is a full rewrite of imgix.js. It now plays nicely with
srcset
,sizes
,picture
, and other modern responsive imagery techniques. You can learn more in the readme!
- Don't reference
window
forlazyLoadScrollContainers
default value if not present. (See #96, thanks @psfrankie!) - Fix Safari double-request issues (See #93, thanks @jordanthomas!)
- Add a workaround for Prototype.js'
Array.prototype
handling. Thanks to @matiasnombarasco for this PR!
- Properly increment version number to 2.2.1 in src/core.js
- Added
lazyLoadScrollContainers
option. Adds scroll listeners to the specified elements, in order to trigger lazy-loading on images that are scrolled into view as part of an overflowed container. Defaults to[window]
, but if this option is specified,window
is not automatically included. Thanks to @joshfrench for making this happen!
- Removed unnecessary
imgix.getRawBackgroundImage
method.
- Fixed a bug in
imgix.getBackgroundImage
that was failing to return a proper background-image URL in some corner cases.
- Removing parameter-specific getters and setters removes a load of bugs related to various image API parameters throwing validation warnings when constructing and manipulating imgix URLs.
- Removed all parameter-specific getters and setters from the
imgix.URL
object (i.e.imgix.URL.getSepia()
,imgix.URL.setWidth()
, et cetera). Instead, you should useimgix.URL.getParam()
andimgix.URL.setParam()
. - Removed all methods for listing and sorting image parameters, as they were frequently out of date:
imgix.getAllParams()
,imgix.getParamAliases()
,imgix.getDefaultParamValues()
,imgix.getDefaultParamValue()
,imgix.getDefaultParams()
. - Also removed all methods related to font lookups, including
imgix.getFontLookup()
,imgix.getFonts()
,imgix.searchFonts()
, andimgix.isFontAvailable()
. - Removed checks when constructing and manipulating imgix URLs that previously validated parameters names and values.
- Renamed
imgix.helpers.getDPR()
method toimgix.helpers.getWindowDPR()
- Removing parameter-specific getters and setters removes a load of bugs related to various image API parameters throwing validation warnings when constructing and manipulating imgix URLs.
- Updated
imgix.URL.getColors()
method to use simple AJAX instead of CSS-injection. As a result of this, colors are being returned from lightest to darkest, rather than from darkest to lightest as they were previously. This change was made to bring the behavior of this method in line with thepalette=json
image API, which it now uses. - Removed several unnecessary polyfills, shaving 4KB off of the minified file size.
- Continuous integration tests are now being done against the library both with and without polyfills.
- Broke core.js up into separate components
- Broke tests up into different files
- Fixed a bug in
imgix.buildUrl()
that was causing port numbers to be ignored - Fixed a bug where
imgix.fluid()
would ignore thecrossorigin
attribute on its targets
N/A
- Optimized scroll-handing when using
lazyLoad
property ofimgix.fluid()
.
N/A
- Upgraded
imgix.onready()
internals to fix a bug in IE and increase legibility.
N/A
- Fixed a bug introduced in 1.1.0 that was generating obscenely long classnames when requesting color-palette CSS.
- Removed all code pertaining to signing imgix URLs with your API token. We decided that this code isn't well-suited for client-side code like imgix.js. If you need to use signed URLs, we suggest using one of our client libraries instead.
- Added a
throttle
parameter toimgix.fluid
. This parameter determines how often lazy-loaded images poll the viewport to determine whether they should load their source or not. This was previously defined by thedebounce
parameter, which also handles polling for window resize events. The default value forthrottle
is 200ms.
- Fixed a bug in our lazyLoad code that was preventing images clipped by the top or left sides of the browser viewport from rendering properly.
- Fixed a bug that could sometimes cause
imgix.fluid
to not behave properly if the source image was already in the browser's cache.
- Added a parameter to all image requests reflecting the current version of imgix.js. This will allow us to better track usage and debug problems with the library in the future.
N/A
N/A
- Fixed a bug that could lead to unexpected requests for (sometimes massive) image files, occuring for elements that have been marked as fluid while it or its parents were set to
display:none;
. See this PR for more details.
- Updated parameter lists and accompanying getters and setters. These had gotten a little out-of-date with newly released imgix API features, so they needed some love.
- Fixed an issue in Safari where lazy-loaded images would repaint relentlessly while scrolling.
fluid
now accepts an element to operate on as an optional first parameter, instead of the entire document (See docs).
N/A
N/A
This release fixes a race condition when using the onLoad
callback with imgix.fluid()
where if multiple image updates are requested before the first image actually loads then fluidUpdateCount
could be incorrect.
attachGradientTo
no longer requires a base color to be passed.rgba
colors are now valid as well. see docs
N/A
attachGradientTo
added toimgix.URL
see docslazyColorSet
config option added toimgix.fluid
see docsonLoad
config callback added toimgix.fluid
see docs
N/A
AMD Support
N/A
Improved pinch zoom by taking scale
value directly from gesture event.
Fixed pinch zoom on iOS devices.
N/A
Ensure version was properly reflected in source code for git tag.
imgix.fluid
now supports maxHeight
and maxWidth
options to ensure no requests over this size are requested automatically via imgix.js. This both default to 5000.
N/A
imgix.fluid
now supports lazy loading of images with when the lazyLoad
option is set to true
. This option defaults to false
for backwards compatibility.
N/A
Add support for the imgix blend API.
N/A
Respect protocol of request.
N/A
imgix.fluid
now supports an ignoreDPR
option that when set to true
never sets the dpr
imgix param (even on retina screens). This option defaults to false
for backwards compatibility
N/A
N/A
- URL.setBlend(val)
- URL.setBlendWidth(val)
- URL.setBlendHeight(val)
- URL.setBlendPadding(val)
- URL.setBlendFit(val)
- URL.setBlendAlpha(val)
- URL.getBlend()
- URL.getBlendWidth()
- URL.getBlendHeight()
- URL.getBlendPadding()
- URL.getBlendFit()
- URL.getBlendAlpha()
For example:
var i = new imgix.URL('http://static-a.imgix.net/macaw.png');
i.setSepia(50).setWidth(50).setHeight(100);
i.attachImageTo('.macaw');
imgix.fluid
now supports a token
option for signing images.
var opts = {
token: "TOKEN_HERE"
}
imgix.onready(function() {
imgix.fluid(opts);
});
N/A