summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-13 12:31:41 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2014-03-13 12:31:41 +0000
commit5624e4a25ffff6fedc0385425ced06240505dcec (patch)
tree19184ae549926d555ad1f3f27b5b17319d930f4c /src
parent92e07f3b7428afa45c865f19377f96afe95a2302 (diff)
[trunk] Always report when decompression failed as return code value
Diffstat (limited to 'src')
-rw-r--r--src/bin/jp2/opj_decompress.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
index 44431f20..aded1996 100644
--- a/src/bin/jp2/opj_decompress.c
+++ b/src/bin/jp2/opj_decompress.c
@@ -881,7 +881,8 @@ int main(int argc, char **argv)
case PGX_DFMT: /* PGX */
if(imagetopgx(image, parameters.outfile)){
- fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
@@ -890,7 +891,8 @@ int main(int argc, char **argv)
case BMP_DFMT: /* BMP */
if(imagetobmp(image, parameters.outfile)){
- fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
@@ -899,7 +901,8 @@ int main(int argc, char **argv)
#ifdef OPJ_HAVE_LIBTIFF
case TIF_DFMT: /* TIFF */
if(imagetotif(image, parameters.outfile)){
- fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
@@ -908,7 +911,8 @@ int main(int argc, char **argv)
#endif /* OPJ_HAVE_LIBTIFF */
case RAW_DFMT: /* RAW */
if(imagetoraw(image, parameters.outfile)){
- fprintf(stdout,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
@@ -917,7 +921,8 @@ int main(int argc, char **argv)
case RAWL_DFMT: /* RAWL */
if(imagetorawl(image, parameters.outfile)){
- fprintf(stdout,"Error generating rawl file. Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Error generating rawl file. Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
@@ -926,7 +931,8 @@ int main(int argc, char **argv)
case TGA_DFMT: /* TGA */
if(imagetotga(image, parameters.outfile)){
- fprintf(stdout,"Error generating tga file. Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Error generating tga file. Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
@@ -935,7 +941,8 @@ int main(int argc, char **argv)
#ifdef OPJ_HAVE_LIBPNG
case PNG_DFMT: /* PNG */
if(imagetopng(image, parameters.outfile)){
- fprintf(stdout,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
+ fprintf(stderr,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
@@ -947,6 +954,7 @@ int main(int argc, char **argv)
*/
default:
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
+ failed = 1;
}
/* free remaining structures */