{"action":"opened","issue":{"url":"https://api.github.com/repos/lvandeve/lodepng/issues/37","repository_url":"https://api.github.com/repos/lvandeve/lodepng","labels_url":"https://api.github.com/repos/lvandeve/lodepng/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/lvandeve/lodepng/issues/37/comments","events_url":"https://api.github.com/repos/lvandeve/lodepng/issues/37/events","html_url":"https://github.com/lvandeve/lodepng/issues/37","id":155140406,"number":37,"title":"lodepng_can_have_alpha gives incorrect result for 8-bit images which haven't yet been decoded","user":{"login":"Dwedit","id":1743498,"avatar_url":"https://avatars.githubusercontent.com/u/1743498?v=3","gravatar_id":"","url":"https://api.github.com/users/Dwedit","html_url":"https://github.com/Dwedit","followers_url":"https://api.github.com/users/Dwedit/followers","following_url":"https://api.github.com/users/Dwedit/following{/other_user}","gists_url":"https://api.github.com/users/Dwedit/gists{/gist_id}","starred_url":"https://api.github.com/users/Dwedit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dwedit/subscriptions","organizations_url":"https://api.github.com/users/Dwedit/orgs","repos_url":"https://api.github.com/users/Dwedit/repos","events_url":"https://api.github.com/users/Dwedit/events{/privacy}","received_events_url":"https://api.github.com/users/Dwedit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-16T22:53:15Z","updated_at":"2016-05-16T22:53:15Z","closed_at":null,"body":"After using \"lodepng_state_init\", then \"lodepng_inspect\", there is not enough information to know if an 8-bit image has alpha or not.  For 8-bit images, \"lodepng_can_have_alpha\" will only give correct results after the image has been completely decoded, which is usually too late for when you want to see if it needs an alpha channel or not.\r\n\r\n\"lodepng_has_palette_alpha\" should have features added to it.  It should check if the image is palettized, then check if the palette has been loaded or not, and if it hasn't been loaded, load the \"PLTE\" and \"tRNS\" chunks so it will have a palette available with possible alpha channel.  That would fix the issue with \"lodepng_can_have_alpha\" yielding incorrect results."}}