Skip to content
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

Convert from WebP? #1

Closed
binarykitchen opened this issue Aug 18, 2014 · 7 comments
Closed

Convert from WebP? #1

binarykitchen opened this issue Aug 18, 2014 · 7 comments
Milestone

Comments

@binarykitchen
Copy link

Hello there

In your examples I do not see if the module is able to convert from WebP to another format like JPEG?

Can you add such an example or at least state that this is not possible?

Thx!

@lbeschastny
Copy link
Member

Hi!

This module is a wrapper around cwebp utility for compressing images to WebP format.

To decompress images back you should use dwebp instead.

Right now node-webp supports only cwebp. Though, It's not very difficult to extend it to support dwebp as well.

@binarykitchen
Copy link
Author

thanks - yes, dwebp support would be great! do you think you could add that?

@lbeschastny
Copy link
Member

I'm extremely busy right now, but I'll try to find time to implement it.

Meanwhile, you may hack node-webp by changing Webp.bin from cwebp to dwebp:

CWebp = require('cwebp');

function DWebp (source, bin) {
  CWebp.constructor.call(this, source, bin)
}

DWebp.bin = 'dwebp';
DWebp.verbose = false;

Promise.prototype.__proto__ = DWebp.prototype;

But you won't be able to use node-webp build-in methods with this new class, only raw command method.

@lbeschastny
Copy link
Member

@binarykitchen just realized that you can specify binPath in a constructor:

var Webp = require('cwebp');
var dwebp = new Webp(source, 'dwebp');

It's much simpler. But build-in methods won't work without proper dwebp support, anyway.

@binarykitchen
Copy link
Author

thanks for the comment but i think i rather wait - take your time

@lbeschastny
Copy link
Member

I started working on dwebp support.

The most difficult problem I'm facing right now is to decide whether I should rename this project on npm or not.

On the one hand, it will no longer be cwebp, because it'll support other webp utils.
On the other hand, it may confuse node-webp users.

Any ideas?

Another problem with renaming the project is that all good webp-related names are already taken.

@lbeschastny lbeschastny added this to the 0.2.x milestone Sep 17, 2014
@binarykitchen
Copy link
Author

why not have a fantasy name but mention webp under keywords + description in the package.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants