RafidMuhymin / astro-imagetools

Image Optimization tools for the Astro JS framework
astro-imagetools-docs.vercel.app
MIT License
407 stars 44 forks source link

Add support for image/svg+xml #143

Open blmarket opened 1 year ago

blmarket commented 1 year ago

This change allows SVG images can be processed by astro-imagetools. (e.g. converting svg into webp etc)

As the file-type library parse the SVG image as 'xml' extension, we should add xml to supportedImageTypes.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments | Name | Status | Preview | Comments | Updated | | :--- | :----- | :------ | :------- | :------ | | **astro-imagetools-demo** | ⬜️ Ignored ([Inspect](https://vercel.com/rafidmuhymin/astro-imagetools-demo/6oE1zMME5APCmT2CjHeZQ6wGPcL7)) | | | Dec 23, 2022 at 9:31PM (UTC) | | **astro-imagetools-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/rafidmuhymin/astro-imagetools-docs/2gLTFV1RZGcCnKgw6pk4qWMQV5Po)) | | | Dec 23, 2022 at 9:31PM (UTC) |
stephanbogner commented 1 year ago

FWIW: My workaround currently is to not process SVG files because in most cases they are smaller in file size than pixel-based image files. But having an option to optimize them using SVGO would be rad.

RafidMuhymin commented 1 year ago

Nice contribution @blmarket, definitely a great addition ! But I agree with @stephanbogner. @blmarket what do you think? Could you please update the PR? I'll be glad to work on this together.