CloudCannon / bookshop

📚 A component development workflow for static websites.
MIT License
247 stars 21 forks source link

fix(astro-engine): Add support for GIF, TIFF and AVIF image imports #197

Closed oliverlynch closed 1 month ago

oliverlynch commented 1 month ago

I'm using astro:image to optimise image assets, which appeared to be working with bookshop until I added a company logo in GIF format.

error: No loader is configured for ".gif" files: src/assets/pages/community/page.md/logo.gif

astro:image uses sharp by default to optimise images, which supports JPEG, PNG, WebP, GIF, AVIF, TIFF and SVG images. Currently bookshop build fails if GIF, TIFF or AVIF images are imported.

I have not tested this patch beyond importing a gif, tiff and avif image and building the site, which appears to work. The tiff image does not render in the editor as tiff is not a supported image format in firefox, however the optimised version of the image on the live site is webp and renders correctly.

Tate-CC commented 1 month ago

Thanks for your contribution @oliverlynch!

These changes all look good to me. The windows tests are having some issues but it doesn't look related, so I'm happy to merge this 👍

bglw commented 1 month ago

Thanks again @oliverlynch 🙂 This has been released in the latest Bookshop version.