From 20bd86fbce5d60f03b0b7d300b93f29c4adc174f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 25 May 2013 18:05:44 +0100 Subject: [PATCH] Live works! --- openlp/core/lib/__init__.py | 3 ++- openlp/plugins/remotes/html/live.html | 2 ++ openlp/plugins/remotes/lib/httpserver.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index d6c338271..6bd20f2fd 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -183,7 +183,8 @@ def image_to_byte(image): # use buffer to store pixmap into byteArray buffie = QtCore.QBuffer(byte_array) buffie.open(QtCore.QIODevice.WriteOnly) - image.save(buffie, "PNG") + if isinstance(image, QtGui.QImage): + image.save(buffie, "PNG") log.debug(u'image_to_byte - end') # convert to base64 encoding so does not get missed! return byte_array.toBase64() diff --git a/openlp/plugins/remotes/html/live.html b/openlp/plugins/remotes/html/live.html index 33a14fd52..fed8f6c98 100644 --- a/openlp/plugins/remotes/html/live.html +++ b/openlp/plugins/remotes/html/live.html @@ -42,6 +42,8 @@ top: 0px; width: 100%%; height: 100%%; + background-size: cover; + background-repeat: no-repeat; } diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 8d4872cfc..a2abbb41e 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -136,6 +136,7 @@ def make_sha_hash(password): """ Create an encrypted password for the given password. """ + log.debug("make_sha_hash") return sha(ntob(password)).hexdigest() @@ -143,6 +144,7 @@ def fetch_password(username): """ Fetch the password for a provided user. """ + log.debug("Fetch Password") if username != Settings().value(u'remotes/user id'): return None return make_sha_hash(Settings().value(u'remotes/password')) @@ -460,7 +462,7 @@ class HttpRouter(object): Return the latest display image as a byte stream. """ result = { - u'slide_image': str(image_to_byte(self.live_controller.slide_image)) + u'slide_image': u'data:image/png;base64,' + str(image_to_byte(self.live_controller.slide_image)) } cherrypy.response.headers['Content-Type'] = u'application/json' return json.dumps({u'results': result})