mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-13 16:29:48 -05:00
Tweak make_image_chunk to produce empty chunk when argc == 2.
This commit is contained in:
parent
184eb9eb0d
commit
61f954dbeb
@ -41,13 +41,17 @@ def write_image(data, path):
|
|||||||
f.write(data)
|
f.write(data)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if len(sys.argv) != 4:
|
if len(sys.argv) == 4:
|
||||||
print(usage_message)
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
input_image = read_image(sys.argv[1])
|
input_image = read_image(sys.argv[1])
|
||||||
tag = sys.argv[2].encode()
|
tag = sys.argv[2].encode()
|
||||||
output_path = sys.argv[3]
|
output_path = sys.argv[3]
|
||||||
|
elif len(sys.argv) == 2:
|
||||||
|
input_image = bytearray()
|
||||||
|
tag = bytearray((0,) * 4)
|
||||||
|
output_path = sys.argv[1]
|
||||||
|
else:
|
||||||
|
print(usage_message)
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
if len(tag) != 4:
|
if len(tag) != 4:
|
||||||
print(usage_message)
|
print(usage_message)
|
||||||
|
Loading…
Reference in New Issue
Block a user