-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
I'm having trouble with the following JPG image when trying to convert it to PNG:
It appears to be trying to use the embedded CMYK ICC profile but failing, the image itself is marked as sRGB. I did wonder if just stripping out the embedded ICC profile out would work, but I'm not sure how to do this, or whether I should be taking a different approach.
This is the code I'm using to convert (as well as resize):
sharp(filename)
.resize(requiredSize.width, requiredSize.height)
.background({r: 0, g: 0, b: 0, a: 0})
.embed()
.png()
.toBuffer().then((outputBuffer) => {
resolve(outputBuffer);
})
.catch((err) => {
console.log('Error creating image:', err);
reject(err);
});
It's very possible I'm doing something very silly in the above!
Many thanks in advance.
Reactions are currently unavailable