[trunk] WIP: correct mistake with JP2 files and manage correctly the text_GBR.jp2 filecase

This commit is contained in:
Mickael Savinaud
2011-10-11 07:49:16 +00:00
parent 7c87bb35c4
commit c7d3b83164
5 changed files with 20 additions and 13 deletions

View File

@@ -579,8 +579,6 @@ int main(int argc, char **argv)
opj_image_t image;
opj_stream_t *cio = NULL; /* Stream */
opj_codec_t* dinfo = NULL; /* Handle to a decompressor */
opj_bool bRes1, bRes2;
char indexfilename[OPJ_PATH_LEN]; /* index file name */
@@ -713,13 +711,8 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
/* Get the decoded image */
bRes1 = opj_decode_v2(dinfo, cio, &image);
bRes2 = opj_end_decompress(dinfo,cio);
/*if ( !(opj_decode_v2(dinfo, cio, &image)) || !(opj_end_decompress(dinfo,cio)) ) {*/
if ( !bRes1 || !bRes2) {
if ( !( opj_decode_v2(dinfo, cio, &image) && opj_end_decompress(dinfo,cio) ) ) {
fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
opj_destroy_codec(dinfo);
opj_stream_destroy(cio);