From 792fa6a1e266926fc412def2a5703f553ad73a29 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 6 Oct 2009 03:09:04 +0000 Subject: Improve JPEG2K format validation logic git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1000 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/jpeg2000/jpeg2ktopam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'converter/other') diff --git a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c index e6db7658..bfcc0db9 100644 --- a/converter/other/jpeg2000/jpeg2ktopam.c +++ b/converter/other/jpeg2000/jpeg2ktopam.c @@ -99,10 +99,10 @@ readJpc(const char * const inputFilename, if (instream == NULL ) pm_error("cannot open input image file '%s'", inputFilename); } - - if (jas_image_getfmt(instream) != jas_image_strtofmt((char*)"jpc")) + assert(jas_image_lookupfmtbyname("jpc")); + if (jas_image_lookupfmtbyname("jpc")->ops.validate(instream) != 0) pm_error("Input is not JPEG-2000 code stream"); - + options = ""; jasperP = jas_image_decode(instream, jas_image_strtofmt((char*)"jpc"), -- cgit 1.4.1