Merge branch 'issue164' into devel
This commit is contained in:
commit
a7e4a5b593
1 changed files with 22 additions and 3 deletions
25
bin/jp2dump
25
bin/jp2dump
|
|
@ -6,10 +6,29 @@ import glymur
|
|||
|
||||
description='Print JPEG2000 metadata.'
|
||||
parser = argparse.ArgumentParser(description=description)
|
||||
parser.add_argument('-c', '--codestream', help='dump codestream',
|
||||
action='store_true')
|
||||
parser.add_argument('-x', '--noxml', help='Suppress XML.',
|
||||
action='store_true')
|
||||
parser.add_argument('-s', '--short', help='Only print box id, offset, and length.',
|
||||
action='store_true')
|
||||
chelp='Level of codestream information. 0 suppressed all details, 1 prints headers, 2 prints the full codestream'
|
||||
parser.add_argument('-c', '--codestream',
|
||||
help=chelp,
|
||||
nargs=1,
|
||||
type=int,
|
||||
default=0)
|
||||
parser.add_argument('filename')
|
||||
args = parser.parse_args()
|
||||
if args.noxml:
|
||||
glymur.set_printoptions(xml=False)
|
||||
if args.short:
|
||||
glymur.set_printoptions(short=True)
|
||||
if args.codestream[0] == 0:
|
||||
glymur.set_printoptions(codestream=False)
|
||||
print_full_codestream = False
|
||||
elif args.codestream[0] == 1:
|
||||
print_full_codestream = False
|
||||
else:
|
||||
print_full_codestream = True
|
||||
|
||||
filename = args.filename
|
||||
glymur.jp2dump(args.filename, codestream=args.codestream)
|
||||
glymur.jp2dump(args.filename, codestream=print_full_codestream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue