Changed spacing
This commit is contained in:
parent
b81aeadd56
commit
2c48cce62a
1 changed files with 2 additions and 10 deletions
10
pnger.py
10
pnger.py
|
@ -4,32 +4,24 @@
|
||||||
@author - e
|
@author - e
|
||||||
@date - 9/3/2013
|
@date - 9/3/2013
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pngit(infile, outfile, nowrite=0):
|
def pngit(infile, outfile, nowrite=0):
|
||||||
outcounter = 0
|
outcounter = 0
|
||||||
with open(outfile, "wb") as theoutf:
|
with open(outfile, "wb") as theoutf:
|
||||||
|
|
||||||
if nowrite == 0:
|
if nowrite == 0:
|
||||||
theoutf.write("\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
|
theoutf.write("\x89\x50\x4E\x47\x0D\x0A\x1A\x0A")
|
||||||
|
|
||||||
with open(infile, "rb") as f:
|
with open(infile, "rb") as f:
|
||||||
|
|
||||||
byte = f.read(1)
|
byte = f.read(1)
|
||||||
while byte != "":
|
while byte != "":
|
||||||
|
|
||||||
if outcounter >= nowrite:
|
if outcounter >= nowrite:
|
||||||
theoutf.write(byte)
|
theoutf.write(byte)
|
||||||
else:
|
else:
|
||||||
outcounter+=1
|
outcounter+=1
|
||||||
|
|
||||||
|
|
||||||
byte = f.read(1)
|
byte = f.read(1)
|
||||||
|
|
||||||
def unpngit(infile, outfile):
|
def unpngit(infile, outfile):
|
||||||
|
|
Reference in a new issue