{"action":"created","issue":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/1125","labels_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1125/labels{/name}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1125/comments","events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1125/events","html_url":"https://github.com/python-pillow/Pillow/pull/1125","id":59830284,"number":1125,"title":"Fix 32-bit BMP loading (RGBA or RGBX)","user":{"login":"artscoop","id":1023091,"avatar_url":"https://avatars.githubusercontent.com/u/1023091?v=3","gravatar_id":"","url":"https://api.github.com/users/artscoop","html_url":"https://github.com/artscoop","followers_url":"https://api.github.com/users/artscoop/followers","following_url":"https://api.github.com/users/artscoop/following{/other_user}","gists_url":"https://api.github.com/users/artscoop/gists{/gist_id}","starred_url":"https://api.github.com/users/artscoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artscoop/subscriptions","organizations_url":"https://api.github.com/users/artscoop/orgs","repos_url":"https://api.github.com/users/artscoop/repos","events_url":"https://api.github.com/users/artscoop/events{/privacy}","received_events_url":"https://api.github.com/users/artscoop/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/python-pillow/Pillow/labels/Needs%20Review","name":"Needs Review","color":"eb6420"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/python-pillow/Pillow/milestones/9","html_url":"https://github.com/python-pillow/Pillow/milestones/2.8.0","labels_url":"https://api.github.com/repos/python-pillow/Pillow/milestones/9/labels","id":840818,"number":9,"title":"2.8.0","description":"","creator":{"login":"hugovk","id":1324225,"avatar_url":"https://avatars.githubusercontent.com/u/1324225?v=3","gravatar_id":"","url":"https://api.github.com/users/hugovk","html_url":"https://github.com/hugovk","followers_url":"https://api.github.com/users/hugovk/followers","following_url":"https://api.github.com/users/hugovk/following{/other_user}","gists_url":"https://api.github.com/users/hugovk/gists{/gist_id}","starred_url":"https://api.github.com/users/hugovk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugovk/subscriptions","organizations_url":"https://api.github.com/users/hugovk/orgs","repos_url":"https://api.github.com/users/hugovk/repos","events_url":"https://api.github.com/users/hugovk/events{/privacy}","received_events_url":"https://api.github.com/users/hugovk/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"closed","created_at":"2014-10-26T09:57:45Z","updated_at":"2015-04-03T16:51:37Z","due_on":"2015-04-01T07:00:00Z","closed_at":"2015-04-02T23:49:08Z"},"comments":10,"created_at":"2015-03-04T17:19:25Z","updated_at":"2015-12-30T18:03:03Z","closed_at":"2015-04-01T19:23:32Z","pull_request":{"url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1125","html_url":"https://github.com/python-pillow/Pillow/pull/1125","diff_url":"https://github.com/python-pillow/Pillow/pull/1125.diff","patch_url":"https://github.com/python-pillow/Pillow/pull/1125.patch"},"body":"PIL choked on perfectly valid BMP files (32 bits with Alpha). It could not handle valid RGBA masks to determine the raw format.\r\nTo clarify things, I:\r\n- Rewrote the `BmpImagePlugin.BmpImageFile` class to be far more readable\r\n- Made error messages more explicit (e.g. say that RLE bitmaps are unsupported)\r\n- Made a readable dict to contain BMP header information\r\n- Kept the existing security checks\r\n- Instead of reading palette info by chunks of 3/4 bytes, read the whole palette info at once and parse the data.\r\n- Now works with BMPv4/5 with Alpha (and can be exported to alpha PNG for example)\r\n- Tested load and save with RGB24, RGB8, RGB8L, RGB32 and RGBA32.\r\n- Tested with one bogus file. File not accepted, as expected.\r\n- Size of header attributes is made explicit in this code\r\n\r\nI wanted to test more BMP formats, but I could not find that many images.\r\nBut for all the types I tested, it worked flawlessly."},"comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments/168046362","html_url":"https://github.com/python-pillow/Pillow/pull/1125#issuecomment-168046362","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1125","id":168046362,"user":{"login":"techtonik","id":515889,"avatar_url":"https://avatars.githubusercontent.com/u/515889?v=3","gravatar_id":"","url":"https://api.github.com/users/techtonik","html_url":"https://github.com/techtonik","followers_url":"https://api.github.com/users/techtonik/followers","following_url":"https://api.github.com/users/techtonik/following{/other_user}","gists_url":"https://api.github.com/users/techtonik/gists{/gist_id}","starred_url":"https://api.github.com/users/techtonik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techtonik/subscriptions","organizations_url":"https://api.github.com/users/techtonik/orgs","repos_url":"https://api.github.com/users/techtonik/repos","events_url":"https://api.github.com/users/techtonik/events{/privacy}","received_events_url":"https://api.github.com/users/techtonik/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T18:03:03Z","updated_at":"2015-12-30T18:03:03Z","body":"@artscoop I can only check this change https://github.com/artscoop/Pillow/commit/6216d079f5bac0a7f13a43b76bf276542c1abd74 because I don't have Visual Studio to compile the whole extension. Let me check."}}