Add webp and avif conversion to strapi-plugin-upload
Derrick Mehaffy
Add option to create copies for uploaded images in webp and avif.
By default the plugin should keep it's behaviour and not convert uploads. But if its configuration is enabled to convert, it should save an additional copy for each breakpoint in every enabled image type.
This two image type formats are very useful to improve web loading time.
Alexander Birkner
Hey, is there already an update to this feature request? Would love to see this in Strapi since it makes content management for users without any knowledge of image manipulation easier and helps optimizing loading times and/or page speed metrics. We do use already Cloudflare with Image optimizations but this isn't perfect at all.
Hauke
Please implement this feature. The local image sharp plugin due to lacking performance of my server instance is veery slow or crashes the server entirely. I would love to see performant web formats to achieve higher scores in lighthouse and spare the loading times.
Josh
Hi Rjbeerens if you would like to submit a PR that would be great!
R
Rjbeerens
Hi! I was just scrolling through the backlog and saw this one. I actually managed to add this feature to our customized upload provider where you can set the option with the plugin settings from the config file. I can provide you guys with my working solution or if wanted, I could open up a PR to add this feature.
J
Jake W
This is a big missing feature for me. The only current solution is uploading the same image in multiple formats.
A
Antoine Stc25
Derrick Mehaffy would the Strapi team accept a PR with this functionality?
Or the core team would rather leave the plugin in a more minimalistic approach, and prefer a community plugin to do the job?
I could be motivated on doing the PR but I would like some validation before committing to it.
The idea: add a optional opt-in param to the configuration of the upload plugin, to tell
image-manipulation.js
to convert all images uploaded to webp
or avif
independent of their original format.This can't be done at the
provider
level because images where already optimized by image-manipulation.js
.Derrick Mehaffy
Antoine Stc25: probably best to submit an RFC first to get validation :)
A
Antoine Stc25
Derrick Mehaffy: you mean: https://github.com/strapi/rfcs ?
I'm a bit lost with Github, Forum and Feedback platforms 😅
Derrick Mehaffy
Antoine Stc25: yes :)
Feedback site is basically feature requests. Forum is just community questions. RFCs are for validation of an idea before you spend time writing a PR.
A
Antoine Stc25
Derrick Mehaffy: just finished it: https://github.com/strapi/rfcs/pull/47 👍
A
Antoine Stc25
For more context; devgar https://github.com/devgar already had a prototype for it: https://github.com/devgar/strapi/blob/243d914efeebfdb44b236af76689c30b73fed646/packages/strapi-plugin-upload/services/image-manipulation.js
Devgar modified the
image-manipulation.js
file to achieve this. Which mean modifying a file in the core
folder.