mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Ensure profile-less CMYK roundtrip skips space conv #3620
This commit is contained in:
parent
2e0f789c9b
commit
b763801d68
@ -20,6 +20,9 @@ Requires libvips v8.14.2
|
||||
[#3615](https://github.com/lovell/sharp/pull/3615)
|
||||
[@TomWis97](https://github.com/TomWis97)
|
||||
|
||||
* Ensure profile-less CMYK to CMYK roundtrip skips colourspace conversion.
|
||||
[#3620](https://github.com/lovell/sharp/issues/3620)
|
||||
|
||||
### v0.32.0 - 24th March 2023
|
||||
|
||||
* Default to using sequential rather than random access read where possible.
|
||||
|
@ -322,7 +322,10 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
} catch(...) {
|
||||
sharp::VipsWarningCallback(nullptr, G_LOG_LEVEL_WARNING, "Invalid embedded profile", nullptr);
|
||||
}
|
||||
} else if (image.interpretation() == VIPS_INTERPRETATION_CMYK) {
|
||||
} else if (
|
||||
image.interpretation() == VIPS_INTERPRETATION_CMYK &&
|
||||
baton->colourspaceInput != VIPS_INTERPRETATION_CMYK
|
||||
) {
|
||||
image = image.icc_transform(processingProfile, VImage::option()
|
||||
->set("input_profile", "cmyk")
|
||||
->set("intent", VIPS_INTENT_PERCEPTUAL));
|
||||
|
@ -93,6 +93,19 @@ describe('Colour space conversion', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Profile-less CMYK roundtrip', async () => {
|
||||
const [c, m, y, k] = await sharp(fixtures.inputJpgWithCmykNoProfile)
|
||||
.pipelineColourspace('cmyk')
|
||||
.toColourspace('cmyk')
|
||||
.raw()
|
||||
.toBuffer();
|
||||
|
||||
assert.deepStrictEqual(
|
||||
{ c, m, y, k },
|
||||
{ c: 55, m: 27, y: 0, k: 0 }
|
||||
);
|
||||
});
|
||||
|
||||
it('From sRGB with RGB16 pipeline, resize with gamma, to sRGB', function (done) {
|
||||
sharp(fixtures.inputPngGradients)
|
||||
.pipelineColourspace('rgb16')
|
||||
|
Loading…
x
Reference in New Issue
Block a user