mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -05:00
Tweak make_image_chunk to produce empty chunk when argc == 2.
This commit is contained in:
parent
184eb9eb0d
commit
61f954dbeb
@ -41,14 +41,18 @@ 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:
|
||||||
|
input_image = read_image(sys.argv[1])
|
||||||
|
tag = sys.argv[2].encode()
|
||||||
|
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)
|
print(usage_message)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
input_image = read_image(sys.argv[1])
|
|
||||||
tag = sys.argv[2].encode()
|
|
||||||
output_path = sys.argv[3]
|
|
||||||
|
|
||||||
if len(tag) != 4:
|
if len(tag) != 4:
|
||||||
print(usage_message)
|
print(usage_message)
|
||||||
sys.exit(-2)
|
sys.exit(-2)
|
||||||
|
Loading…
Reference in New Issue
Block a user