ENH: Better solution: using the opj_version function to stay up to date

This commit is contained in:
Mathieu Malaterre 2006-07-21 21:00:19 +00:00
parent 190b4b7c9e
commit f222743e19
1 changed files with 6 additions and 3 deletions

View File

@ -665,9 +665,12 @@ int main(int argc, char **argv) {
}
if(parameters.cp_comment == NULL) {
const char comment[] = "Created by OpenJPEG version 1.0";
parameters.cp_comment = (char*)malloc(strlen(comment)+1);
strcpy(parameters.cp_comment, comment);
const char comment[] = "Created by OpenJPEG version ";
const size_t clen = strlen(comment);
const char *version = opj_version();
parameters.cp_comment = (char*)malloc(clen+strlen(version)+1);
strncpy(parameters.cp_comment, comment, clen); /* clen bytes */
strcpy(parameters.cp_comment+clen, version); /* strlen(version) + \0 */
}
/* decode the source image */