-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebP output - killer feature #114
Comments
It's just a matter of using vips to handle scaling. Sory for my spaghetti code it was long learning curve for me: https://github.com/slav123/go-resizer but basically this library solves your problem: |
The problem with bimg (and vips) is that it's a cgo library, not pure go. I'm not willing to take on C dependencies, since it adds complexity that I don't really want to deal with and doesn't really solve any problems that I have. Others are of course free to use cgo libraries in their own forks, but I don't have plans to accept them in this copy of imageproxy. |
What about https://github.com/nickalie/go-webpbin? |
that's simply a wrapper around a command line tool, not an actual go library. |
And https://github.com/chai2010/webp instead? |
chai2010/webp is using cgo, which makes things more complicated and less portable (read more at https://dave.cheney.net/2016/01/18/cgo-is-not-go). As people have added more caching storage backends, and the imageproxy binary size has grown pretty substantially, I've been thinking about how to rearchitect it to have some sort of plugin system. If and when that were to happen, I'd be fine with added an optional plugin that used cgo or called out to separate process. But as things are now, my plan is to limit it to pure go. |
Well, good to discover new things. |
@willnorris has anything change regarding webp support in go? |
Not that I'm aware of |
@slav123 Does the code of your service still exist somewhere? I'm basically looking for exactly what you seem to have build – an image proxy that conditionally converts PNG or JPG to webp if the requesting browser supports it. EDIT: Never mind, just found in in your comment above. |
Hi,
Look for project called "imaginary" - it's pretty much what I was building on my own.
I will share my project on Monday maybe (I'm on holidays right now)
pozdrawiam Sławomir Jasiński
… On 11 Sep 2020, at 17:15, Fabrizio Ruggeri ***@***.***> wrote:
https://caravaggio.ramielcreations.com/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
There's also https://github.com/imgproxy/imgproxy if you want to stick with something written in (mostly) go. They use cgo, which allows them to add webp support, use vips for faster transformations and encoding, etc. |
I forked this project to add webp encoding. Hopefully it is useful to some folks. I have it in production and it is quite stable. |
This is very nice. Why not put a pr here? |
Because I wouldn't merge it :) As discussed in this and related issues, I've decided to keep imageproxy as only using pure go libraries, not any that require cgo. https://github.com/kolesa-team/go-webp, which @zquestz's fork uses, requires cgo. |
I see. Maybe document this fork in the readme for better visibility? |
filed #353 to track that |
Pardon my ignorance, but how would someone who already uses ImageProxy install and utilize your fork in order to realize .webp in/out? |
Easiest way is with docker. Then in your resizer call, add webp as the output. For instance |
Thank you, we're running an existing command line process in a production environment which runs a batch file with "imageproxy -allowHosts *host.com". Since your fork has the same name, I'm just not very clear on how it would work to attempt to run an alternate library. Likely, it's my own ignorance on the subject. I wish the primary ImageProxy library had webp support, with Google PageSpeed now giving sites a negative score for sites that don't offer "next gen formats". |
Ahh to build it. Just do the following:
This should build a working binary with the updated feature set. |
I wrote similar service a while ago. Idea almost exactly as yours - for me killer feature was option to serve webp images as an output. It was based on browser detection (Chrome & Opera). Maybe there is a change at least ad ,webp output in yours ?
The text was updated successfully, but these errors were encountered: