{"action":"created","issue":{"url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/53","labels_url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/53/comments","events_url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/53/events","html_url":"https://github.com/SkillCollege/SimplifyReader/issues/53","id":121174738,"number":53,"title":"Nexus 5x扫码的蛋疼问题","user":{"login":"xiaozhi003","id":4998101,"avatar_url":"https://avatars.githubusercontent.com/u/4998101?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaozhi003","html_url":"https://github.com/xiaozhi003","followers_url":"https://api.github.com/users/xiaozhi003/followers","following_url":"https://api.github.com/users/xiaozhi003/following{/other_user}","gists_url":"https://api.github.com/users/xiaozhi003/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaozhi003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaozhi003/subscriptions","organizations_url":"https://api.github.com/users/xiaozhi003/orgs","repos_url":"https://api.github.com/users/xiaozhi003/repos","events_url":"https://api.github.com/users/xiaozhi003/events{/privacy}","received_events_url":"https://api.github.com/users/xiaozhi003/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-09T06:48:27Z","updated_at":"2015-12-11T01:42:50Z","closed_at":null,"body":"最近买了5x，可是他的照相问题确实蛋疼啊。首先扫码预览图是倒着的，这个查看官方文档设置setDisplayOrientation可以迅速兼容起来。原本以为这样就开开心心解决了，但是总是事与愿违PreviewCallback返回的数据确实是横屏，但是横屏的方向也与其他种类的手机相反，别人返回的是头朝左，5x返回的是头朝右；也就是说我把data翻转过来5x的图像与预览的图像是反着的；这样导致你扫码的时候明明把二维码放到了框中却解析不了。\r\n\r\n目前我自己解决办法：\r\n因为不知道是5x或者6p手机的原因还是api 23的问题，那么我目前为止是判断是否是5x，并且在decodeCrop方法中传入的top坐标为cameraHieght - mCropRect.top - mCropRect.height()，这样可以顺利解决；\r\n\r\n其实以上方式不大好，感觉正确的应该是根据data来判断orientation；当然目前没有找到对byte直接返回orientation的方法或者开源的项目；本人去zxing项目翻了好几页的issue也只是找到了解决5x预览正确；\r\n\r\n可能有人会说先把data转成Bitmap然后对方向进行调整（因为我们可以对Bitmap的方向做调整），然后扫码解析的时候再把Bitmap转成data，我不知道这样行不行，但至少效率太低；\r\n\r\n不知道 @SkillCollege 有什么好的办法"},"comment":{"url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/comments/163807237","html_url":"https://github.com/SkillCollege/SimplifyReader/issues/53#issuecomment-163807237","issue_url":"https://api.github.com/repos/SkillCollege/SimplifyReader/issues/53","id":163807237,"user":{"login":"SkillCollege","id":6345287,"avatar_url":"https://avatars.githubusercontent.com/u/6345287?v=3","gravatar_id":"","url":"https://api.github.com/users/SkillCollege","html_url":"https://github.com/SkillCollege","followers_url":"https://api.github.com/users/SkillCollege/followers","following_url":"https://api.github.com/users/SkillCollege/following{/other_user}","gists_url":"https://api.github.com/users/SkillCollege/gists{/gist_id}","starred_url":"https://api.github.com/users/SkillCollege/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkillCollege/subscriptions","organizations_url":"https://api.github.com/users/SkillCollege/orgs","repos_url":"https://api.github.com/users/SkillCollege/repos","events_url":"https://api.github.com/users/SkillCollege/events{/privacy}","received_events_url":"https://api.github.com/users/SkillCollege/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T01:42:50Z","updated_at":"2015-12-11T01:42:50Z","body":"@xiaozhi003 为什么不继续写下你的灵感呢？"}}