next-optimized-images icon indicating copy to clipboard operation
next-optimized-images copied to clipboard

Optimizing images coming from firebase

Open Jagadesh-Ram opened this issue 4 years ago • 9 comments

I have a requirement of using this package to optimize and resize gifs in a website. Basically i want to provide the url of the image to the require function and make it work, when i try to do this i get a error saying module not found. #120 I just happened see the version 3 is on the way, i just want to do a quick reminder to the team that if this is possible, i believe there are alternatives like cloudinary and imgix, probably way more than that but currently i cannot afford them!. Help this poor guy! @cyrilwanner

Jagadesh-Ram avatar Jun 26 '20 18:06 Jagadesh-Ram

So, you would like to pull images from a source URL instead from a local source? I'm having actually the same requirement. @cyrilwanner the canary version seems to have support for it, but it's not yet documented. Could you help us out with a little hint, so we can try it out?

JannikZed avatar Jul 24 '20 14:07 JannikZed

It is a planned feature but not yet included in the canary version. But I'll definitely include that feature. I'll inform you once the feature can be tested in the canary version.

cyrilwanner avatar Jul 25 '20 12:07 cyrilwanner

perfect! Thanks man :)

JannikZed avatar Jul 26 '20 09:07 JannikZed

@cyrilwanner any updates on this feature???

Jagadesh-Ram avatar Aug 03 '20 11:08 Jagadesh-Ram

I found this: https://github.com/wbunting/with-image-preprocessing let me know if it can be usefulI

ild0tt0re avatar Sep 16 '20 19:09 ild0tt0re

@ild0tt0re will let you know!! thanks for the find.

Jagadesh-Ram avatar Sep 16 '20 19:09 Jagadesh-Ram

We are using now caravaggio: https://link.medium.com/1fPSRDUzQ9 Works like a charm!

JannikZed avatar Sep 17 '20 06:09 JannikZed

@JannikZed how is this different from fastly and cloudinary. Like am having gifs in my firebase. Will this hook fetched the gif from firebase and populate it once the webpage is loaded?

Jagadesh-Ram avatar Sep 17 '20 07:09 Jagadesh-Ram

you will create a new API route and all gifs in your project get their URL replaced with your new API route. That means, that the requested gif is not directly coming from firebase, but from your API route, that is requesting then the file from firebase, optimizing it to a size and quality measure of your choice and sends it back to the client. The second time the file gets requested it is already for example in the vercel CDN. It is just a on-the-fly image optimization.

JannikZed avatar Sep 17 '20 08:09 JannikZed