{"action":"created","issue":{"url":"https://api.github.com/repos/libyal/libewf/issues/21","labels_url":"https://api.github.com/repos/libyal/libewf/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/libyal/libewf/issues/21/comments","events_url":"https://api.github.com/repos/libyal/libewf/issues/21/events","html_url":"https://github.com/libyal/libewf/issues/21","id":75607467,"number":21,"title":"Time estimate appears to use integer GB to calculate estimate","user":{"login":"gregfreemyer","id":894673,"avatar_url":"https://avatars.githubusercontent.com/u/894673?v=3","gravatar_id":"","url":"https://api.github.com/users/gregfreemyer","html_url":"https://github.com/gregfreemyer","followers_url":"https://api.github.com/users/gregfreemyer/followers","following_url":"https://api.github.com/users/gregfreemyer/following{/other_user}","gists_url":"https://api.github.com/users/gregfreemyer/gists{/gist_id}","starred_url":"https://api.github.com/users/gregfreemyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregfreemyer/subscriptions","organizations_url":"https://api.github.com/users/gregfreemyer/orgs","repos_url":"https://api.github.com/users/gregfreemyer/repos","events_url":"https://api.github.com/users/gregfreemyer/events{/privacy}","received_events_url":"https://api.github.com/users/gregfreemyer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libyal/libewf/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-05-12T13:41:17Z","updated_at":"2015-05-13T13:07:05Z","closed_at":"2015-05-12T20:50:02Z","body":"Using ewfacquire 20140608 (not the newer experimental release).\r\n\r\nI happen to notice the initial time estimate can be way off, but then it jumps drastically on the 1GB updates.\r\n\r\nIt's like the code does something like:\r\n\r\ntime_remaining = total_GB * (time_in_progress / int(GB_done))\r\n\r\nThus in the first few GB the error is pretty drastic.  In particular, my 2 1/2 hour image was estimating 5 hours at the 1.9 GB process stage, but then corrected to 2 1/2 hours on the next update."},"comment":{"url":"https://api.github.com/repos/libyal/libewf/issues/comments/101656936","html_url":"https://github.com/libyal/libewf/issues/21#issuecomment-101656936","issue_url":"https://api.github.com/repos/libyal/libewf/issues/21","id":101656936,"user":{"login":"gregfreemyer","id":894673,"avatar_url":"https://avatars.githubusercontent.com/u/894673?v=3","gravatar_id":"","url":"https://api.github.com/users/gregfreemyer","html_url":"https://github.com/gregfreemyer","followers_url":"https://api.github.com/users/gregfreemyer/followers","following_url":"https://api.github.com/users/gregfreemyer/following{/other_user}","gists_url":"https://api.github.com/users/gregfreemyer/gists{/gist_id}","starred_url":"https://api.github.com/users/gregfreemyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregfreemyer/subscriptions","organizations_url":"https://api.github.com/users/gregfreemyer/orgs","repos_url":"https://api.github.com/users/gregfreemyer/repos","events_url":"https://api.github.com/users/gregfreemyer/events{/privacy}","received_events_url":"https://api.github.com/users/gregfreemyer/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T13:07:05Z","updated_at":"2015-05-13T13:07:05Z","body":"The same patch using ints is below.  Pick it up or not.  I find it a useful improvement.  For now I will carry it in my openSUSE package.\r\n\r\n<pre><code>\r\nIndex: libewf-20150126/ewftools/process_status.c\r\n===================================================================\r\n--- libewf-20150126.orig/ewftools/process_status.c\r\n+++ libewf-20150126/ewftools/process_status.c\r\n@@ -347,6 +347,7 @@ int process_status_update(\r\n        int64_t remaining_number_of_seconds = 0;\r\n        int64_t total_number_of_seconds     = 0;\r\n        int8_t new_percentage               = 0;\r\n+       int16_t new_percentage_x_100        = 0;\r\n \r\n        if( process_status == NULL )\r\n        {\r\n@@ -366,7 +367,9 @@ int process_status_update(\r\n                if( ( bytes_total > 0 )\r\n                 && ( bytes_read > 0 ) )\r\n                {\r\n-                       new_percentage = (int8_t) ( ( bytes_read * 100 ) / bytes_total );\r\n+                       /* assumes bytes_read is <= 922 TB or 64-bit int will overflow */\r\n+                       new_percentage_x_100 = (int16_t) (( bytes_read * 100 * 100 ) / bytes_total) ;\r\n+                       new_percentage = (int8_t) ( new_percentage_x_100 / 100 );\r\n                }\r\n                if( libcdatetime_elements_set_current_time_localtime(\r\n                     process_status->current_time_elements,\r\n@@ -459,7 +462,8 @@ int process_status_update(\r\n \r\n                        if( new_percentage > 0 )\r\n                        {\r\n-                               total_number_of_seconds     = ( ( number_of_seconds * 100 ) / new_percentage );\r\n+                               total_number_of_seconds     = ( ( number_of_seconds * 100 * 100 ) / new_percentage_x_100 );\r\n                                remaining_number_of_seconds = total_number_of_seconds - number_of_seconds;\r\n \r\n                                /* Negative time means nearly finished\r\n\r\n</code></pre>"}}