{"action":"created","issue":{"url":"https://api.github.com/repos/ugovaretto/tjpp/issues/9","repository_url":"https://api.github.com/repos/ugovaretto/tjpp","labels_url":"https://api.github.com/repos/ugovaretto/tjpp/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/ugovaretto/tjpp/issues/9/comments","events_url":"https://api.github.com/repos/ugovaretto/tjpp/issues/9/events","html_url":"https://github.com/ugovaretto/tjpp/issues/9","id":173029501,"number":9,"title":"colorspace != pixel format","user":{"login":"TimDykes","id":5446095,"avatar_url":"https://avatars.githubusercontent.com/u/5446095?v=3","gravatar_id":"","url":"https://api.github.com/users/TimDykes","html_url":"https://github.com/TimDykes","followers_url":"https://api.github.com/users/TimDykes/followers","following_url":"https://api.github.com/users/TimDykes/following{/other_user}","gists_url":"https://api.github.com/users/TimDykes/gists{/gist_id}","starred_url":"https://api.github.com/users/TimDykes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimDykes/subscriptions","organizations_url":"https://api.github.com/users/TimDykes/orgs","repos_url":"https://api.github.com/users/TimDykes/repos","events_url":"https://api.github.com/users/TimDykes/events{/privacy}","received_events_url":"https://api.github.com/users/TimDykes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ugovaretto/tjpp/labels/bug","name":"bug","color":"ee0701"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-24T18:50:49Z","updated_at":"2016-08-25T08:10:54Z","closed_at":null,"body":"In TjDeCompressor.h we call:\r\n\r\n        tjDecompressHeader3(tjDeCompressor_,\r\n                               jpgImg,\r\n                               size,\r\n                               &width,\r\n                               &height,\r\n                               &jpegSubsamp,\r\n                               &colorSpace))\r\n\r\nthen later call:\r\n\r\n        if(tjDecompress2(tjDeCompressor_, jpgImg, size, img_.DataPtr(),\r\n                         width, pitch, height, colorSpace, flags))\r\n\r\nThe problem is that a turbo jpeg colorspace (TJCS) is not the same as a turbo jpeg pixel format (TJPF). The TJCS (colorSpace) returned by tjDecompressHeader3 cannot be passed as a TJPF to tjDecompress2.\r\n\r\nIt seems the pixel format isnt actually stored in the header, or at least isnt exposed by tjDecompressHeader3 and there seems to be no other header related functions. This means you must know the pixel format in advance and pass it directly to the Decompress() function along with the data pointer, size, flags and pitch. \r\n\r\n\r\n( For TJCS vs TCPF: https://cdn.rawgit.com/libjpeg-turbo/libjpeg-turbo/master/doc/html/group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720 )"},"comment":{"url":"https://api.github.com/repos/ugovaretto/tjpp/issues/comments/242311790","html_url":"https://github.com/ugovaretto/tjpp/issues/9#issuecomment-242311790","issue_url":"https://api.github.com/repos/ugovaretto/tjpp/issues/9","id":242311790,"user":{"login":"TimDykes","id":5446095,"avatar_url":"https://avatars.githubusercontent.com/u/5446095?v=3","gravatar_id":"","url":"https://api.github.com/users/TimDykes","html_url":"https://github.com/TimDykes","followers_url":"https://api.github.com/users/TimDykes/followers","following_url":"https://api.github.com/users/TimDykes/following{/other_user}","gists_url":"https://api.github.com/users/TimDykes/gists{/gist_id}","starred_url":"https://api.github.com/users/TimDykes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimDykes/subscriptions","organizations_url":"https://api.github.com/users/TimDykes/orgs","repos_url":"https://api.github.com/users/TimDykes/repos","events_url":"https://api.github.com/users/TimDykes/events{/privacy}","received_events_url":"https://api.github.com/users/TimDykes/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T08:10:54Z","updated_at":"2016-08-25T08:10:54Z","body":"Actually I think we have to use the *2 version, as this can extract the pixel format from the header which is necessary for decompression. \r\n\r\nWhat I intended to do was replace the *3 version with *2, extract all the colorspace related stuff into colorspace.h, and replace the colorspace stuff in Image.h with TJPF as in JPEGImage (because the colorspace stuff is wrong anyway, so it shouldn't really be included)"}}
{"actor":{"display_login":"TimDykes"}}