Deleting incomplete SSTV image files.
This commit is contained in:
parent
fef7826b55
commit
e5fcbbfe5b
|
|
@ -77,8 +77,8 @@ class SstvParser(ThreadModule):
|
||||||
logger.debug("Closing bitmap file '%s'." % self.fileName)
|
logger.debug("Closing bitmap file '%s'." % self.fileName)
|
||||||
self.file.close()
|
self.file.close()
|
||||||
self.file = None
|
self.file = None
|
||||||
if self.line==0:
|
if self.height==0 or self.line<self.height:
|
||||||
logger.debug("Deleting empty bitmap file '%s'." % self.fileName)
|
logger.debug("Deleting short bitmap file '%s'." % self.fileName)
|
||||||
os.unlink(self.fileName)
|
os.unlink(self.fileName)
|
||||||
except Exception:
|
except Exception:
|
||||||
self.file = None
|
self.file = None
|
||||||
|
|
@ -162,9 +162,9 @@ class SstvParser(ThreadModule):
|
||||||
w = self.data.find(b']')
|
w = self.data.find(b']')
|
||||||
if w>=0:
|
if w>=0:
|
||||||
# Extract message contents
|
# Extract message contents
|
||||||
msg = self.data[0:w+1].decode()
|
msg = self.data[2:w].decode()
|
||||||
# Log message
|
# Log message
|
||||||
logger.debug(msg)
|
logger.debug("SSTV: %s" % msg)
|
||||||
# Compose result
|
# Compose result
|
||||||
out = {
|
out = {
|
||||||
"mode": "SSTV",
|
"mode": "SSTV",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue