From 3eea3caf6bbd621188dda699e1aa707d7d524fc6 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Tue, 29 May 2018 15:12:47 +1000 Subject: [PATCH] Use imgix auto=format for automatic webp conversion --- CHANGELOG.md | 4 ++++ src/util/getImageUrl.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 933e877..82946b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.8 - 2018-05-29 + +* Use imgix auto=format for automatic webp conversion + ## 0.2.7 - 2018-05-25 * Update slugify() util function to support plural initialisms diff --git a/src/util/getImageUrl.js b/src/util/getImageUrl.js index 6f1a0cc..ed6f513 100644 --- a/src/util/getImageUrl.js +++ b/src/util/getImageUrl.js @@ -4,7 +4,7 @@ const resizedDir = '/images/uploads/resized/' const imgixUrl = null // imgix web folder domain e.g. https://example.imgix.net (no trailing slash) const getImgixUrl = ({ path, size }) => - `${imgixUrl}${encodeURI(path)}?w=${size}&fit=max&auto=compress` + `${imgixUrl}${encodeURI(path)}?w=${size}&fit=max&auto=compress,format` const parseFilename = filename => { const parts = filename.match(/(.+)\.([\w]+)$/)