Skip to content

Commit

Permalink
🐛 Fixed responsive images for .icos
Browse files Browse the repository at this point in the history
closes #10301

- we allow .ico files for icons, but we cannot resize these specialist files at present
  • Loading branch information
ErisDS committed Jan 15, 2019
1 parent 0d8aa92 commit d58ecda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/server/lib/image/manipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions core/test/unit/lib/image/manipulator_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit d58ecda

Please sign in to comment.