{"action":"created","issue":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/1279","repository_url":"https://api.github.com/repos/tesseract-ocr/tesseract","labels_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/1279/labels{/name}","comments_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/1279/comments","events_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/1279/events","html_url":"https://github.com/tesseract-ocr/tesseract/issues/1279","id":289431503,"node_id":"MDU6SXNzdWUyODk0MzE1MDM=","number":1279,"title":"get_isdigit() failing causes program to abort","user":{"login":"craigbroadbear","id":8934268,"node_id":"MDQ6VXNlcjg5MzQyNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/8934268?v=4","gravatar_id":"","url":"https://api.github.com/users/craigbroadbear","html_url":"https://github.com/craigbroadbear","followers_url":"https://api.github.com/users/craigbroadbear/followers","following_url":"https://api.github.com/users/craigbroadbear/following{/other_user}","gists_url":"https://api.github.com/users/craigbroadbear/gists{/gist_id}","starred_url":"https://api.github.com/users/craigbroadbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigbroadbear/subscriptions","organizations_url":"https://api.github.com/users/craigbroadbear/orgs","repos_url":"https://api.github.com/users/craigbroadbear/repos","events_url":"https://api.github.com/users/craigbroadbear/events{/privacy}","received_events_url":"https://api.github.com/users/craigbroadbear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-01-17T22:09:08Z","updated_at":"2018-09-29T15:55:26Z","closed_at":null,"author_association":"NONE","body":"------------------------\r\n\r\n### Environment\r\n\r\n* **Tesseract Version**:  latest master from github cloned on 18 Jan 2018\r\n* **Commit Number**:\r\n* **Platform**: Windows 10, 32 bit build using Visual studio 2017  -->\r\n\r\n### Current Behavior:\r\nMy program which statically links to tesseract libs crashes / aborts on some images.  Note I can not reproduce this issue using command line tesseract, only from my code.\r\n\r\n### Expected Behavior:\r\nNo crash.\r\n\r\n### Suggested Fix:\r\n\r\nget_isdigit - should not abort.  Just return true or false yes?\r\n\r\nReplace current get_isdigit() function in ccutil/unicharset.h with:\r\n```\r\n\r\n  bool get_isdigit(UNICHAR_ID unichar_id) const {\r\n    if (INVALID_UNICHAR_ID == unichar_id) return false;\r\n    //ASSERT_HOST(contains_unichar_id(unichar_id)); // CRAIG COMMENT - comment out to stop ABORTS\r\n\tif (!contains_unichar_id(unichar_id)) return false; // CRAIG COMMENT - added line to stop ABORTS\r\n\treturn unichars[unichar_id].properties.isdigit;\r\n  }\r\n```\r\n\r\nThat seems to do the trick.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/comments/425655285","html_url":"https://github.com/tesseract-ocr/tesseract/issues/1279#issuecomment-425655285","issue_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/1279","id":425655285,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTY1NTI4NQ==","user":{"login":"zdenop","id":574156,"node_id":"MDQ6VXNlcjU3NDE1Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/574156?v=4","gravatar_id":"","url":"https://api.github.com/users/zdenop","html_url":"https://github.com/zdenop","followers_url":"https://api.github.com/users/zdenop/followers","following_url":"https://api.github.com/users/zdenop/following{/other_user}","gists_url":"https://api.github.com/users/zdenop/gists{/gist_id}","starred_url":"https://api.github.com/users/zdenop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdenop/subscriptions","organizations_url":"https://api.github.com/users/zdenop/orgs","repos_url":"https://api.github.com/users/zdenop/repos","events_url":"https://api.github.com/users/zdenop/events{/privacy}","received_events_url":"https://api.github.com/users/zdenop/received_events","type":"User","site_admin":false},"created_at":"2018-09-29T15:55:26Z","updated_at":"2018-09-29T15:55:26Z","author_association":"CONTRIBUTOR","body":"@Shreeshrii  (or whoever has time ;-) ): can you test if this modification has effect on quality of OCR?"}}
{"actor":{"display_login":"zdenop"}}