Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Unable to include SVG icons #47

Closed
satazor opened this issue Feb 7, 2018 · 3 comments
Closed

Unable to include SVG icons #47

satazor opened this issue Feb 7, 2018 · 3 comments

Comments

@satazor
Copy link
Contributor

satazor commented Feb 7, 2018

If there's a SVG icon inside icons, this package fails with the following error:

It was not possible to read 'src/icons/some.svg'.

This happens because we are using jimp to resize the images but it doesn't support SVGs. And it shouldn't because SVGs are scalable by nature, thus they don't need to be resampled. My suggestion is to detect SVGs via the type (and fallback to extension) and skip jimp if the detection identified a SVG.

Do you agree with this? If so, I will make a PR to implement this strategy.

@madmoizo
Copy link

madmoizo commented Feb 7, 2018

Indeed, jimp can process png, jpg and bmp so it would be nice to check if the file matchs one of these extensions (and maybe log a warning if you want to resize an unsupported image file extension like .webp)

@arthurbergmz
Copy link
Owner

@satazor sounds nice. if you make a PR, I will probably release it as v3.4.2.

@satazor
Copy link
Contributor Author

satazor commented Feb 8, 2018

@arthurbergmz 👍 will do.

@acostalima acostalima mentioned this issue Feb 8, 2018
1 task
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants