{"action":"created","issue":{"url":"https://api.github.com/repos/komone/qrcode/issues/8","labels_url":"https://api.github.com/repos/komone/qrcode/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/komone/qrcode/issues/8/comments","events_url":"https://api.github.com/repos/komone/qrcode/issues/8/events","html_url":"https://github.com/komone/qrcode/issues/8","id":118503226,"number":8,"title":"Runtime error when switching from 'M' error correction to 'H'","user":{"login":"zepplock","id":677451,"avatar_url":"https://avatars.githubusercontent.com/u/677451?v=3","gravatar_id":"","url":"https://api.github.com/users/zepplock","html_url":"https://github.com/zepplock","followers_url":"https://api.github.com/users/zepplock/followers","following_url":"https://api.github.com/users/zepplock/following{/other_user}","gists_url":"https://api.github.com/users/zepplock/gists{/gist_id}","starred_url":"https://api.github.com/users/zepplock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zepplock/subscriptions","organizations_url":"https://api.github.com/users/zepplock/orgs","repos_url":"https://api.github.com/users/zepplock/repos","events_url":"https://api.github.com/users/zepplock/events{/privacy}","received_events_url":"https://api.github.com/users/zepplock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/komone/qrcode/labels/In%20Progress","name":"In Progress","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-24T00:09:55Z","updated_at":"2015-12-20T23:37:07Z","closed_at":null,"body":"If I switch code `encode(Bin, 'M').` to `encode(Bin, 'H').` in `qrcode.erl`.\r\n\r\nI get this:\r\n\r\n```\r\n** (exit) an exception was raised:\r\n    ** (FunctionClauseError) no function clause matching in :qrcode_matrix.encode_bits0/2\r\n        (qrcode) src/qrcode_matrix.erl:169: :qrcode_matrix.encode_bits0([:d, :d, :d, :d, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1], <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 0::size(1)>>)\r\n        (qrcode) src/qrcode_matrix.erl:164: :qrcode_matrix.encode_bits/3\r\n        (qrcode) src/qrcode_matrix.erl:53: :qrcode_matrix.finalize/5\r\n        (qrcode) src/qrcode.erl:43: :qrcode.encode/2\r\n        (qrcode) src/qrcode_png.erl:50: :qrcode_png.run/1\r\n        (shoqr) web/controllers/v1/session_controller.ex:46: Shoqr.V1.SessionController.show_qr/2\r\n        (shoqr) web/controllers/v1/session_controller.ex:11: Shoqr.V1.SessionController.phoenix_controller_pipeline/2\r\n        (shoqr) lib/phoenix/router.ex:265: Shoqr.Router.dispatch/2\r\n        (shoqr) web/router.ex:11: Shoqr.Router.do_call/2\r\n        (shoqr) lib/shoqr/endpoint.ex:11: Shoqr.Endpoint.phoenix_pipeline/1\r\n        (shoqr) lib/plug/debugger.ex:90: Shoqr.Endpoint.\"call (overridable 3)\"/2\r\n        (shoqr) lib/phoenix/endpoint/render_errors.ex:34: Shoqr.Endpoint.call/2\r\n        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4\r\n        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4\r\n```\r\n\r\nNote that switching to `L` or `Q` works fine."},"comment":{"url":"https://api.github.com/repos/komone/qrcode/issues/comments/166165224","html_url":"https://github.com/komone/qrcode/issues/8#issuecomment-166165224","issue_url":"https://api.github.com/repos/komone/qrcode/issues/8","id":166165224,"user":{"login":"zepplock","id":677451,"avatar_url":"https://avatars.githubusercontent.com/u/677451?v=3","gravatar_id":"","url":"https://api.github.com/users/zepplock","html_url":"https://github.com/zepplock","followers_url":"https://api.github.com/users/zepplock/followers","following_url":"https://api.github.com/users/zepplock/following{/other_user}","gists_url":"https://api.github.com/users/zepplock/gists{/gist_id}","starred_url":"https://api.github.com/users/zepplock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zepplock/subscriptions","organizations_url":"https://api.github.com/users/zepplock/orgs","repos_url":"https://api.github.com/users/zepplock/repos","events_url":"https://api.github.com/users/zepplock/events{/privacy}","received_events_url":"https://api.github.com/users/zepplock/received_events","type":"User","site_admin":false},"created_at":"2015-12-20T23:37:07Z","updated_at":"2015-12-20T23:37:07Z","body":"Thanks for looking into this Steve!"}}