#Compress Image while uploading to server

17 messages · Page 1 of 1 (latest)

burnt oxide
#

In my next.js web app, I want to upload local images to server but want to first compress them like converting them into avif format just before uploading to server. Is there any way to do this?

solar boltBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

keen swift
#

You should do compressing stuff on server, not on Next.js

burnt oxide
#

I want to do on browser side not on server side.

keen swift
burnt oxide
#

I am trying to use WASM-ImageMagick but there are issues in that

keen swift
#

no idea what that is

#

last published 4 years ago

#

Why are you persistent to use it on browser tho?

burnt oxide
#

As I don't want to send heavy image files to server and then compress them. Instead I want to send already compressed image to server.

keen swift
#

okay, upto you

#

I don't see any good tools to compress in browser

#

and server is supposed to do heavy things

#

so I don't understand what you are trying to accomplish

jolly meadow
# burnt oxide I want to do on browser side not on server side.

you can't do that on browser side, but you can do that on your machine, write script that you'll run either in production build either manually, and compress images, then upload to git and vercel will get it from there, but you need to use <img> instead <Image> or add unoptimized attribute so vercel ignore them for optimization.

burnt oxide
#

I don't want to do that in my machine

jolly meadow