Black priplan9topng
@@ -23,6 +23,7 @@ data immediately after the image.
import array
import collections
+
# http://www.python.org/doc/2.3.5/lib/module-itertools.html
import itertools
@@ -84,7 +85,6 @@ def plan9_open_image(inp):
# doesn't work.
info, blocks = glue(inp, r)
-
return info, blocks
@@ -164,7 +164,7 @@ def plan9_image_rows(blocks, metadata):
planes=nchans,
)
- arraycode = 'BH'[bitdepth > 8]
+ arraycode = "BH"[bitdepth > 8]
return (
map(
@@ -348,6 +348,7 @@ def deblock(f):
o.append(o[offset + j])
return row, bytes(o)
+
FontChar = collections.namedtuple("FontChar", "x top bottom left width")
@@ -415,8 +416,7 @@ def font_copy(inp, image, out, control):
if ch.width == 0:
continue
- print("png","index", output_index, "glyph", name, i,
- file=control, sep=",")
+ print("png", "index", output_index, "glyph", name, i, file=control, sep=",")
info = dict(image.info, size=(ch.width, height))
target = new_image(info)
@@ -453,7 +453,9 @@ def image_draw(target, rect, source, point):
# colour conversion. But maybe later?
if target.info["planes"] != source.info["planes"]:
- raise NotImplementedError("source and target must have the same number of planes")
+ raise NotImplementedError(
+ "source and target must have the same number of planes"
+ )
if target.info["bitdepth"] != source.info["bitdepth"]:
raise NotImplementedError("source and target must have the same bitdepth")
@@ -497,8 +499,7 @@ def main(argv=None):
if not args.font:
image.write(png.binary_stdout())
else:
- font_copy(args.input, image, png.binary_stdout(),
- sys.stderr)
+ font_copy(args.input, image, png.binary_stdout(), sys.stderr)
if __name__ == "__main__":
