[trunk] moved comment marker setup from opj_compress to the library

This commit is contained in:
Antonin Descampe 2014-07-01 13:51:55 +00:00
parent 45313a8dfa
commit a38b97fae0
2 changed files with 16 additions and 16 deletions

View File

@ -1572,22 +1572,6 @@ int main(int argc, char **argv) {
return 1;
}
/* Create comment for codestream */
if(parameters.cp_comment == NULL) {
const char comment[] = "Created by OpenJPEG version ";
const size_t clen = strlen(comment);
const char *version = opj_version();
/* UniPG>> */
#ifdef USE_JPWL
parameters.cp_comment = (char*)malloc(clen+strlen(version)+11);
sprintf(parameters.cp_comment,"%s%s with JPWL", comment, version);
#else
parameters.cp_comment = (char*)malloc(clen+strlen(version)+1);
sprintf(parameters.cp_comment,"%s%s", comment, version);
#endif
/* <<UniPG */
}
/* Read directory if necessary */
if(img_fol.set_imgdir==1){
num_images=get_num_images(img_fol.imgdirpath);

View File

@ -6124,6 +6124,22 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
cp->tw = 1;
cp->th = 1;
/* Create comment for codestream */
if(parameters->cp_comment == NULL) {
const char comment[] = "Created by OpenJPEG version ";
const size_t clen = strlen(comment);
const char *version = opj_version();
/* UniPG>> */
#ifdef USE_JPWL
parameters->cp_comment = (char*)malloc(clen+strlen(version)+11);
sprintf(parameters->cp_comment,"%s%s with JPWL", comment, version);
#else
parameters->cp_comment = (char*)malloc(clen+strlen(version)+1);
sprintf(parameters->cp_comment,"%s%s", comment, version);
#endif
/* <<UniPG */
}
/* FIXME ADE: to be removed once deprecated cp_cinema and cp_rsiz have been removed */
if (parameters->rsiz == OPJ_PROFILE_NONE) { /* consider deprecated fields only if RSIZ has not been set */
OPJ_BOOL deprecated_used = OPJ_FALSE;