From d58ecda9a950b31bbec71b52076b689d42146b45 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 15 Jan 2019 17:40:09 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20responsive=20images=20fo?= =?UTF-8?q?r=20.icos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #10301 - we allow .ico files for icons, but we cannot resize these specialist files at present --- core/server/lib/image/manipulator.js | 2 +- core/test/unit/lib/image/manipulator_spec.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/server/lib/image/manipulator.js b/core/server/lib/image/manipulator.js index f70b4a88a9..41711d1885 100644 --- a/core/server/lib/image/manipulator.js +++ b/core/server/lib/image/manipulator.js @@ -40,7 +40,7 @@ const unsafeResizeImage = (originalBuffer, {width, height} = {}) => { // as there has been support added in underlying libvips library https://github.com/lovell/sharp/issues/1372 // As for .svg files, sharp only supports conversion to png, and this does not // play well with animated svg files -const canTransformFileExtension = ext => !['.gif', '.svg', '.svgz'].includes(ext); +const canTransformFileExtension = ext => !['.gif', '.svg', '.svgz', '.ico'].includes(ext); const makeSafe = fn => (...args) => { try { diff --git a/core/test/unit/lib/image/manipulator_spec.js b/core/test/unit/lib/image/manipulator_spec.js index 4cef53b2c1..954f4e5247 100644 --- a/core/test/unit/lib/image/manipulator_spec.js +++ b/core/test/unit/lib/image/manipulator_spec.js @@ -31,6 +31,12 @@ describe('lib/image: manipulator', function () { false ); }); + it('returns false for ".ico"', function () { + should.equal( + manipulator.canTransformFileExtension('.ico'), + false + ); + }); }); describe('cases', function () {