int main(int argc, char *argv[])
{
+ FILE *fp;
+ char *xmldata, type[]="xml ";
+ long fsize, boxsize;
+
if( argc<3){
fprintf( stderr, "USAGE: ./addXMLinJP2 modifing.jp2 adding.xml\n");
return -1;
}
-
- FILE *fp;
- char *xmldata, type[]="xml ";
- long fsize, boxsize;
fp = open_jp2file( argv[1]);
if( !fp)
fprintf( stderr, "Original JP2 %s not found\n", filename);
return NULL;
}
- // Check resource is a JP family file.
+ /* Check resource is a JP family file. */
if( fseek( fp, 0, SEEK_SET)==-1){
fclose(fp);
fprintf( stderr, "Original JP2 %s broken (fseek error)\n", filename);
return NULL;
}
- data = (char *)malloc( 12); // size of header
+ data = (char *)malloc( 12); /* size of header */
if( fread( data, 12, 1, fp) != 1){
free( data);
fclose(fp);
FILE *fp;
char *data;
- // fprintf( stderr, "open %s\n", filename);
+ /* fprintf( stderr, "open %s\n", filename);*/
if(!(fp = fopen( filename, "r"))){
fprintf( stderr, "XML file %s not found\n", filename);
return NULL;
#define USE_OPJ_DEPRECATED
/* set this macro to enable profiling for the given test */
/* warning : in order to be effective, openjpeg must have been built with profiling enabled !! */
-//#define _PROFILE
+/*#define _PROFILE*/
#include <stdio.h>
#include <string.h>
l_param.cp_reduce = 0;
/* to decode only a part of the image data */
- //opj_restrict_decoding(&l_param,0,0,1000,1000);
+ /*opj_restrict_decoding(&l_param,0,0,1000,1000);*/
switch(l_param.decod_format) {
opj_destroy_codec(l_codec);
opj_image_destroy(l_image);
- // Print profiling
- //PROFPRINT();
+ /* Print profiling*/
+ /*PROFPRINT();*/
return EXIT_SUCCESS;
}
fprintf(stdout, "Encoding random values -> keep in mind that this is very hard to compress\n");
for (i=0;i<l_data_size;++i) {
- l_data[i] = i; //rand();
+ l_data[i] = i; /*rand();*/
}
opj_set_default_encoder_parameters(&l_param);
++l_current_param_ptr;
}
- // should we do j2k or jp2 ?
+ /* should we do j2k or jp2 ?*/
len = strlen( output_file );
if( strcmp( output_file + len - 4, ".jp2" ) == 0 )
{
free(l_data);
- // Print profiling
- //PROFPRINT();
+ /* Print profiling*/
+ /*PROFPRINT();*/
return 0;
}