strapi:main ← strapi:poc/media-builder
opened 07:04AM - 12 Jun 23 UTC
### What does it do?
Proposes a more composable way to define file transforma…tions, that allows:
- Using other libraries rather than sharp for image transformations (gm, jimp, ...)
- This is a TODO and I have a working setup using jimp.
- Better handling of libvips and sharp memory configurations
- Remove transformations and let providers such as cloudinary handle them.
This is still a draft and a work in progress.
I also used this opportunity to clean a bit the upload plugin, specially the main upload service https://github.com/strapi/strapi/pull/16978/files#diff-3c0f1c68e7bcad4702d7bd9600b9ca459715158a9451da2ae05454d163cada16 .
### Why is it needed?
Sharp is a fast and reliable tool to transform images that we rely upon in Strapi. Unfortunately, in some Linux machines, there seems to be some sort of memory fragmentation that causes RAM spikes and memory fragmentation.
https://github.com/lovell/sharp/issues/3052
https://github.com/lovell/sharp/issues/1710
https://github.com/lovell/sharp/issues/955
Because of the nature of this issue we decided to move this forward in an extensible way, where anyone can create it's own custom solution that works for each setup.
We are going to continue exploring this and see what tools we can provide to better handle issues like this one.
### How to test it?
Provide information about the environment and the path to verify the behaviour.
### Related issue(s)/PR(s)
Fixes https://github.com/strapi/strapi/issues/14417