Strip trailing newlines from live text

This commit is contained in:
AuroraWright
2024-02-11 13:50:42 +01:00
parent 4b998d24c3
commit 3b60ee8674

View File

@@ -331,9 +331,9 @@ class AppleLiveText:
process = Popen([self.helper_executable], stdout=PIPE, stdin=PIPE, stderr=PIPE)
stdout, stderr = process.communicate(input=self._preprocess(img))
stdout = stdout.decode()
stdout = stdout.decode().rstrip()
if stdout == '':
return (False, stderr.decode())
return (False, stderr.decode().rstrip())
return (True, stdout)
def _preprocess(self, img):