Sharp: vips_colourspace: no known route from 'srgb' to 'rgb'

Created on 12 Mar 2019  路  2Comments  路  Source: lovell/sharp

[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 
}
question

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OleVik picture OleVik  路  3Comments

natural-law picture natural-law  路  3Comments

paulieo10 picture paulieo10  路  3Comments

vermin1337 picture vermin1337  路  3Comments

janaz picture janaz  路  3Comments