{"action":"created","issue":{"url":"https://api.github.com/repos/lovell/sharp/issues/646","repository_url":"https://api.github.com/repos/lovell/sharp","labels_url":"https://api.github.com/repos/lovell/sharp/issues/646/labels{/name}","comments_url":"https://api.github.com/repos/lovell/sharp/issues/646/comments","events_url":"https://api.github.com/repos/lovell/sharp/issues/646/events","html_url":"https://github.com/lovell/sharp/issues/646","id":193914421,"number":646,"title":"embedding lab TIFF to png with alpha channel fails","user":{"login":"DaGaMs","id":236646,"avatar_url":"https://avatars.githubusercontent.com/u/236646?v=3","gravatar_id":"","url":"https://api.github.com/users/DaGaMs","html_url":"https://github.com/DaGaMs","followers_url":"https://api.github.com/users/DaGaMs/followers","following_url":"https://api.github.com/users/DaGaMs/following{/other_user}","gists_url":"https://api.github.com/users/DaGaMs/gists{/gist_id}","starred_url":"https://api.github.com/users/DaGaMs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaGaMs/subscriptions","organizations_url":"https://api.github.com/users/DaGaMs/orgs","repos_url":"https://api.github.com/users/DaGaMs/repos","events_url":"https://api.github.com/users/DaGaMs/events{/privacy}","received_events_url":"https://api.github.com/users/DaGaMs/received_events","type":"User","site_admin":false},"labels":[{"id":100863200,"url":"https://api.github.com/repos/lovell/sharp/labels/triage","name":"triage","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-06T23:20:27Z","updated_at":"2016-12-11T16:09:22Z","closed_at":null,"body":"I'm experiencing a bug with a specific type of tiff file (16bit, lab) when I try to convert it to an thumbnail in RGBA with transparent background. The error message is:\r\n\r\n```\r\nvips_colourspace: no known route from 'multiband' to 'lab'\r\nvips_colourspace: no known route from 'multiband' to 'srgb'\r\n```\r\n\r\nInterestingly, when I set the `background` to `white` instead of `{r: 0, g: 0, b: 0, a: 0}`, the error does *not* occur, but the background is black instead of white!\r\n\r\nI've looked through the previous discussion relating to this error, but couldn't find any clues as to what might be going on with this particular image (_i.e._ it has an ICC profile, and it's not a GIF)\r\n\r\nHere's the original image:\r\n![LAB TIFF](https://dl.dropboxusercontent.com/u/816576/tiff_16-bit-lab_example.tiff)\r\n\r\nThe code looks roughly like this:\r\n\r\n```javascript\r\nvar resizer = sharp()\r\n  .sequentialRead();\r\n\r\nresizer = resizer.resize(width, height)\r\n  .background({r: 0, g: 0, b: 0, a: 0})\r\n  .embed();\r\n\r\nresizer = resizer.png();\r\n\r\nfileStream\r\n  .pipe(resizer)\r\n  .on(\"info\", (info) => {\r\n    console.log('Read file of size ' + info.size);\r\n  })\r\n  .on(\"error\", (err) => {\r\n    console.error(\"Error processing image data: \" + err);\r\n  })\r\n  .pipe(outputStream);\r\n```\r\n\r\nInstalled tool versions:\r\n\r\n- sharp: 0.16.2\r\n- vips: `libvips 8.5.0-Sat Nov 12 18:29:10 UTC 2016`\r\n- GraphicsMagick: 1.3.23\r\n\r\nAny help would be much appreciated!"},"comment":{"url":"https://api.github.com/repos/lovell/sharp/issues/comments/266290442","html_url":"https://github.com/lovell/sharp/issues/646#issuecomment-266290442","issue_url":"https://api.github.com/repos/lovell/sharp/issues/646","id":266290442,"user":{"login":"lovell","id":210965,"avatar_url":"https://avatars.githubusercontent.com/u/210965?v=3","gravatar_id":"","url":"https://api.github.com/users/lovell","html_url":"https://github.com/lovell","followers_url":"https://api.github.com/users/lovell/followers","following_url":"https://api.github.com/users/lovell/following{/other_user}","gists_url":"https://api.github.com/users/lovell/gists{/gist_id}","starred_url":"https://api.github.com/users/lovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovell/subscriptions","organizations_url":"https://api.github.com/users/lovell/orgs","repos_url":"https://api.github.com/users/lovell/repos","events_url":"https://api.github.com/users/lovell/events{/privacy}","received_events_url":"https://api.github.com/users/lovell/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T16:09:21Z","updated_at":"2016-12-11T16:09:21Z","body":"Commit d245526 allows the embed (and extend) operations to work with an alpha-transparency background using non-(s)RGB input images.\r\n\r\nlibvips was unable to determine the colourspace as being LAB+alpha approximately [here](https://github.com/jcupitt/libvips/blob/master/libvips/colour/colourspace.c#L526). Luckily we already know the colourspace so can pass it via the `source_space` parameter.\r\n\r\nIn addition, the RGBA colour passed to the `background()` function had to be converted into the LAB colourspace before the embed operation.\r\n\r\nThis will be fixed in v0.17.0 - thanks for reporting."}}
{"actor":{"display_login":"lovell"}}