diff options
author | Thomas Groman <tgroman@nuegia.net> | 2020-04-20 20:56:28 -0700 |
---|---|---|
committer | Thomas Groman <tgroman@nuegia.net> | 2020-04-20 20:56:28 -0700 |
commit | 508d270a4d78d491bbe1c67c309c404f547da58a (patch) | |
tree | d16e2a906501dcda7b4d268579896f03e125f553 /build/pypng/pnglsch | |
parent | f9cab004186edb425a9b88ad649726605080a17c (diff) | |
download | webbrowser-508d270a4d78d491bbe1c67c309c404f547da58a.tar webbrowser-508d270a4d78d491bbe1c67c309c404f547da58a.tar.gz webbrowser-508d270a4d78d491bbe1c67c309c404f547da58a.tar.lz webbrowser-508d270a4d78d491bbe1c67c309c404f547da58a.tar.xz webbrowser-508d270a4d78d491bbe1c67c309c404f547da58a.zip |
added Comm Build System
Diffstat (limited to 'build/pypng/pnglsch')
-rw-r--r-- | build/pypng/pnglsch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/build/pypng/pnglsch b/build/pypng/pnglsch new file mode 100644 index 0000000..d10d238 --- /dev/null +++ b/build/pypng/pnglsch @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# $URL: http://pypng.googlecode.com/svn/trunk/code/pnglsch $ +# $Rev: 107 $ +# pnglsch +# PNG List Chunks + +import png + +def list(out, inp): + r = png.Reader(file=inp) + for t,v in r.chunks(): + add = '' + if len(v) <= 28: + add = ' ' + v.encode('hex') + print >>out, "%s %10d%s" % (t, len(v), add) + +def main(argv=None): + import sys + + if argv is None: + argv = sys.argv + arg = argv[1:] + + if len(arg) > 0: + f = open(arg[0], 'rb') + else: + f = sys.stdin + return list(sys.stdout, f) + +if __name__ == '__main__': + main() |