diff --git a/tools/data2png.py b/tools/data2png.py index 5d09033858..c91a894da0 100755 --- a/tools/data2png.py +++ b/tools/data2png.py @@ -9,6 +9,7 @@ # [height][width]u32 # # [height][width]f32 +# [height][width]f64 # # [height][width][3]i8 # [height][width][3]u8 @@ -24,6 +25,10 @@ import numpy as np import png +if "purepng" not in png.__file__: + print("data2png works only with purepng, not pypng.", file=sys.stderr) + sys.exit(1) + def read_image(f): # Skip binary header. @@ -93,7 +98,6 @@ def read_image(f): with open(infile, "rb") as f_in: width, height, img = read_image(f_in) - with open(outfile, "wb") as f_out: w = png.Writer(width=width, height=height, alpha=False) w.write(f_out, img)