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

Sharpening images with alpha channel results in vips_colourspace: no known route between 'multiband' and 'srgb' #490

Closed
jwagner opened this issue Jul 4, 2016 · 3 comments
Labels
Milestone

Comments

@jwagner
Copy link

jwagner commented Jul 4, 2016

To reproduce:

var sharp = require('sharp');
var request = require('request');
var img = sharp();
// this fails:
img.sharpen(2.0, 0.125, 0.2);
// this works: img.sharpen();
img.toFile('test.png');
request('http://bin.staticlocal.ch.s3-website-eu-west-1.amazonaws.com/localplace-logo/c5/c5d70ab09e8a39f3481ca488560b92e3a1ff0b86/amaya_logo.png').pipe(img);

Expected behaviour:
The sharpened image is saved

Actual behaviour:

Unhandled rejection Error: vips_colourspace: no known route between 'multiband' and 'srgb'
    at Error (native)

It only happens on certain images. I'm not sure whats exactly triggering it.

@lovell
Copy link
Owner

lovell commented Jul 4, 2016

Hi Jonas, the parameter-less version of sharpen uses a fast, kernel-based convolution. The with-params version calls vips_sharpen, which converts to the LAB colourspace. It looks like the output ends up being the generic "multiband" when the input, such as your example, contains an alpha channel.

Commit 4c172d2 adds a (previously failing) test case for this as well as the fix.

Thanks for reporting!

@lovell lovell added the bug label Jul 4, 2016
@lovell lovell added this to the v0.15.1 milestone Jul 4, 2016
@lovell lovell changed the title Sharpening certain images results in vips_colourspace: no known route between 'multiband' and 'srgb' Sharpening images with alpha channel results in vips_colourspace: no known route between 'multiband' and 'srgb' Jul 4, 2016
@jwagner
Copy link
Author

jwagner commented Jul 5, 2016

You are very quick sir! :) Thank you!

@lovell
Copy link
Owner

lovell commented Jul 12, 2016

v0.15.1 now available.

@lovell lovell closed this as completed Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants