[My Background: I don't have much knowledge on image processing ]
Code
let image = sharp(this.fileData) // this.fileData is a buffer.
.clone()
.toColorspace('rgb')
.jpeg()
.toBuffer();
And file meta data
{ format: 'png',
size: 196626,
width: 1280,
height: 1024,
space: 'srgb',
channels: 4,
depth: 'uchar',
density: 72,
isProgressive: false,
hasProfile: false,
hasAlpha: true
}
One more thing. According to the document,
Throws Error Invalid parameters
If I do .toColourspace("foo"), i'm NOT getting any error.
Hello, conversion from non-linear sRGB to linear RGB requires a colour profile, however you'll have to wait for #1323 to address this. Please subscribe to it for updates.
I agree that the current validation is too loose - I expect #1323 to address this also.
Most helpful comment
Hello, conversion from non-linear sRGB to linear RGB requires a colour profile, however you'll have to wait for #1323 to address this. Please subscribe to it for updates.
I agree that the current validation is too loose - I expect #1323 to address this also.