]> granicus.if.org Git - openjpeg/commitdiff
[trunk] moved comment marker setup from opj_compress to the library
authorAntonin Descampe <antonin@gmail.com>
Tue, 1 Jul 2014 13:51:55 +0000 (13:51 +0000)
committerAntonin Descampe <antonin@gmail.com>
Tue, 1 Jul 2014 13:51:55 +0000 (13:51 +0000)
src/bin/jp2/opj_compress.c
src/lib/openjp2/j2k.c

index f0ff3e4de9a239e2dd9caaa39bcc59c902b2147c..f2b3f2fb17a3467b03382e4568b02008d1a2fd48 100644 (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);
index 881cc72c7336fb1beca3d39275ded92070b5db9c..955537354ede457e12fae692b0d2978fdb011552 100644 (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;