indiekit
indiekit copied to clipboard
Media endpoint: Support modifying images prior to uploading
Is your feature request related to a problem? Please describe. I want to be able to quickly upload photos to my media endpoint but I want to do some normalization before they are saved to my public git repo. For example I want my images not to include location data and to be somewhat compressed.
Describe the solution you’d like I would like to see a config option to register a middleware function that is able to modify files before they are uploaded to the store.
Describe alternatives you’ve considered I currently do image normalization manually using squoosh.app. I looked at the endpoint-media package and didn't see any relevant configuration options.
@aciccarello Take a look at #700. As it stands, the implementation allows you provide options per post type under the media
option and apply Sharp resize options before uploading.
Nice, I took a quick look and that seems simple enough. I'll have to play around with the sharp options and see how they turn out. 👍