[trunk] Remove warning about unused function

Update issue 268
This commit is contained in:
Mathieu Malaterre 2014-03-03 08:27:40 +00:00
parent a68a3feb60
commit d14c475de7
1 changed files with 30 additions and 22 deletions

View File

@ -46,24 +46,17 @@ static int jpip_to_jp2(int argc,char *argv[])
{ {
jpip_dec_param_t *dec; jpip_dec_param_t *dec;
if( argc < 3){
fprintf( stderr, "Too few arguments:\n");
fprintf( stderr, " - input jpt or jpp file\n");
fprintf( stderr, " - output jp2 file\n");
return -1;
}
dec = init_jpipdecoder( OPJ_TRUE); dec = init_jpipdecoder( OPJ_TRUE);
if(!( fread_jpip( argv[1], dec))) if(!( fread_jpip( argv[1], dec)))
return -1; return 1;
decode_jpip( dec); decode_jpip( dec);
if(!(fwrite_jp2k( argv[2], dec))) if(!(fwrite_jp2k( argv[2], dec)))
return -1; return 1;
output_log( OPJ_TRUE, OPJ_FALSE, OPJ_TRUE, dec); /* output_log( OPJ_TRUE, OPJ_FALSE, OPJ_TRUE, dec); */
destroy_jpipdecoder( &dec); destroy_jpipdecoder( &dec);
@ -85,22 +78,15 @@ static int jpip_to_j2k(int argc,char *argv[])
{ {
jpip_dec_param_t *dec; jpip_dec_param_t *dec;
if( argc < 3){
fprintf( stderr, "Too few arguments:\n");
fprintf( stderr, " - input jpt or jpp file\n");
fprintf( stderr, " - output j2k file\n");
return -1;
}
dec = init_jpipdecoder( OPJ_FALSE); dec = init_jpipdecoder( OPJ_FALSE);
if(!( fread_jpip( argv[1], dec))) if(!( fread_jpip( argv[1], dec)))
return -1; return 1;
decode_jpip( dec); decode_jpip( dec);
if(!( fwrite_jp2k( argv[2], dec))) if(!(fwrite_jp2k( argv[2], dec)))
return -1; return 1;
/* output_log( OPJ_TRUE, OPJ_FALSE, OPJ_FALSE, dec); */ /* output_log( OPJ_TRUE, OPJ_FALSE, OPJ_FALSE, dec); */
@ -111,6 +97,28 @@ static int jpip_to_j2k(int argc,char *argv[])
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
/* MM: FIXME */ char *ext;
if( argc < 3){
fprintf( stderr, "Too few arguments:\n");
fprintf( stderr, " - input jpt or jpp file\n");
fprintf( stderr, " - output j2k file\n");
return 1;
}
ext = strrchr( argv[2], '.' );
if( ext )
{
// strcasecmp ?
if( strcmp(ext, ".jp2" ) == 0 )
{
return jpip_to_jp2(argc,argv); return jpip_to_jp2(argc,argv);
}
if( strcmp(ext, ".j2k" ) == 0 )
{
return jpip_to_j2k(argc,argv);
}
}
fprintf( stderr, "Invalid file extension for output file: %s\n", argv[2]);
return 1;
} }