about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-10-09 03:06:44 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2009-10-09 03:06:44 +0000
commit5821c709fe6b9099884c7260b3070b9a699a85d6 (patch)
tree15dfde48c0d825ff4d083f88d11ea5f67b9d7699
parent3203359a3febd554f4031fedad45019dd7fd12fd (diff)
downloadnetpbm-mirror-5821c709fe6b9099884c7260b3070b9a699a85d6.tar.gz
netpbm-mirror-5821c709fe6b9099884c7260b3070b9a699a85d6.tar.xz
netpbm-mirror-5821c709fe6b9099884c7260b3070b9a699a85d6.zip
Don't dump box unless debug is turned on
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1005 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/jpeg2000/libjasper/README4
-rw-r--r--converter/other/jpeg2000/libjasper/jp2/jp2_cod.c5
-rw-r--r--converter/other/jpeg2000/libjasper/jp2/jp2_dec.c4
3 files changed, 8 insertions, 5 deletions
diff --git a/converter/other/jpeg2000/libjasper/README b/converter/other/jpeg2000/libjasper/README
index 27aaacd3..b0512fe8 100644
--- a/converter/other/jpeg2000/libjasper/README
+++ b/converter/other/jpeg2000/libjasper/README
@@ -6,10 +6,12 @@ The adaptation was done by Bryan Henderson on 2002.10.26.
 
 The adaptation involved:
 
-  - remove stuff for formats other than JPEG-2000.
+  - Remove stuff for formats other than JPEG-2000.
 
   - Replace build stuff (Jasper uses GNU Autoconf/Automake/Libtool).
 
+  - Make JP2 decoder not dump the box to stderr unless debug is turned on.
+
 See <http://www.ece.uvic.ca/~mdadams/jasper/>.
 
 
diff --git a/converter/other/jpeg2000/libjasper/jp2/jp2_cod.c b/converter/other/jpeg2000/libjasper/jp2/jp2_cod.c
index cb70fd24..f8fc013b 100644
--- a/converter/other/jpeg2000/libjasper/jp2/jp2_cod.c
+++ b/converter/other/jpeg2000/libjasper/jp2/jp2_cod.c
@@ -337,8 +337,9 @@ jp2_box_t *jp2_box_get(jas_stream_t *in)
 		jas_stream_close(tmpstream);
 	}
 
-	jp2_box_dump(box, stderr);
-
+	if (jas_getdbglevel() > 0) {
+        jp2_box_dump(box, stderr);
+    }
 	return box;
 	abort();
 
diff --git a/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c b/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c
index 3cce9278..aaebf411 100644
--- a/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c
+++ b/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c
@@ -340,7 +340,8 @@ jas_image_t *jp2_decode(jas_stream_t *in, char *optstr)
 		iccp = dec->colr->data.colr.iccp;
 		cs = (iccp[16] << 24) | (iccp[17] << 16) | (iccp[18] << 8) |
 		  iccp[19];
-		jas_eprintf("ICC Profile CS %08x\n", cs);
+        if (jas_getdbglevel() > 1)
+            jas_eprintf("ICC Profile CS %08x\n", cs);
 		jas_image_setcolorspace(dec->image, fromiccpcs(cs));
 		break;
 	}
@@ -454,7 +455,6 @@ jas_image_t *jp2_decode(jas_stream_t *in, char *optstr)
 		jas_eprintf("error: no components\n");
 		goto error;
 	}
-fprintf(stderr, "no of components is %d\n", jas_image_numcmpts(dec->image));
 
 	/* Prevent the image from being destroyed later. */
 	image = dec->image;