tannerdolby / eleventy-plugin-sharp-respimg

Eleventy plugin which performs build-time image transformations and generates responsive image markup.
https://www.npmjs.com/package/eleventy-plugin-sharp-respimg
MIT License
8 stars 3 forks source link

Setting the formats #4

Closed tristengrant closed 1 year ago

tristengrant commented 1 year ago

Is there a way to set what formats I'd like? Right now it seems to only use webp and jpeg. Some images may be better as a png.

tristengrant commented 1 year ago

Can you crop an image? Say, for a thumbnail.

tannerdolby commented 1 year ago

👋 thanks for raising an issue! Currently there isn't a way to specify image formats, I originally developed this with webp and jpeg support but never got around to supporting the full spectrum e.g. WebP, JPEG, PNG, AVIF.

I am working on adding this functionality and it should be ready by the end of the week!

Regarding cropping an image, this plugin doesn't support that but you could open a separate issue and we can discuss it in more detail. I know Sharp has a tile-based zoom utility which could be used for a thumbnail, but in general thumbnail photos will have a specific dimension regardless of zoom or any tiling effect which should be obtainable from the plugins current functionality.

tannerdolby commented 1 year ago

🚨 After giving this some thought, I'm going to advise all users of eleventy-plugin-sharp-respimg to migrate to the official responsive image plugin eleventy-img which is created by the Eleventy team.

This was a tough decision but I think its healthier for the 11ty community to first reach for the official eleventy-img before other user contributed options.

I hope this doesn't cause you too much trouble. Happy new year!