pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
3.95k stars 285 forks source link

[Question] is there any way to optimize the image, crop, compress it before uploading? #188

Closed ig4e closed 1 year ago

ig4e commented 1 year ago

is there any way to optimize the image, crop, compress it before uploading? The docs don't mention anything about optimizations. And using it with next.js and making the functions optimize the image with the execution time limitations could be challenging so I wanted to ask about this!

Sorry if this is Unrelated

markflorkowski commented 1 year ago

We don't have any built in methods for doing anything like this, but typically in the past I would do those sort of things in a hidden canvas on the client before uploading my file wherever it was destined to go.

In the future we do want to add the ability to pre- and post-process files, but that is still a ways off for now.

ig4e commented 1 year ago

We don't have any built in methods for doing anything like this, but typically in the past I would do those sort of things in a hidden canvas on the client before uploading my file wherever it was destined to go.

In the future we do want to add the ability to pre- and post-process files, but that is still a ways off for now.

Thanks! I hope this feature comes soon since it's crucial to the goal of uploadthing (making it easy for developers to make production ready media uploading without the hassle of aws s3, lambda functions, etc...)

juliusmarminge commented 1 year ago

@ig4e check out #194 - i made an example of how you can preprocess images and crop them

ig4e commented 1 year ago

@ig4e check out #194 - i made an example of how you can preprocess images and crop them

Thanks I'll definitely check it