indiekit icon indicating copy to clipboard operation
indiekit copied to clipboard

Media endpoint: Support modifying images prior to uploading

Open aciccarello opened this issue 3 years ago • 2 comments

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 avatar Dec 31 '21 05:12 aciccarello

@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.

paulrobertlloyd avatar Feb 28 '24 19:02 paulrobertlloyd

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. 👍

aciccarello avatar Feb 28 '24 19:02 aciccarello