Mark0's Forum
Software => TrID File Identifier => Topic started by: yh on April 26, 2011, 07:44:20 AM
-
hi markc! first thanks!
I download the c++ demo then running the program but can't get the match values,why?
eg:
trd.GetInfo(TRID_GET_RES_POINTS, i, buf);
printf("Matching points: %s\n\n", ret);
printf:
matching points n
I want to get the percent:
%55 <.JPG> JFIF-EXIF....
%33.3
my english is bad ,i hope you can understand and help me.
-
Hi!
Let's see if I understand correctly (my English isn't top notch too, so... :D ).
You mean you get the value / points, but you want the percentage also?
That's easy. The percentage is simply the incidence of one result to the sum of points of all results.
So, if you get 3 results like:
Filetype A 5000
Filetype B 2500
Filetype C 2500
The percentages would be, respectively, 50%, 25%, 25%.
Hope this helps,
Bye!
-
Hi mark0! Thanks for your fast response and your effort!
I know my problem.
-- in the c++ demo
ret = trd.GetInfo(TRID_GET_RES_NUM,0,buf);
for(int i = ret+1; --i;)
{
trd.GetInfo(TRID_GET_RES_FILETYPE,i,buf);
printf("File type: %s\n",buf);
trd.GetInfo(TRID_GET_RES_FILEEXT,i,buf);;
printf("File ext: .%s\n",buf);
trd.GetInfo(TRID_GET_RES_POINTS,i,buf);
printf("Matching points: %d\n\n",ret); // I think this is a bug . Because the "ret" always equal "trd.GetInfo(TRID_GET_RES_NUM,0,buf)"
// So i can't get the right match values.
}
match = trd.GetInfo(TRID_GET_RES_POINTS,i,buf);
printf("Matching points: %d\n\n",match); // This code can print the right match values.
-
I have not much experience in C++, and the sample source was kindly provided by another user.
Indeed a var assignment is missing in the last call to trd.GetInfo.
I will update the sample code.
Thanks,
Bye!