forked from openlp/openlp
Live works!
This commit is contained in:
parent
e1f3024ff1
commit
20bd86fbce
@ -183,6 +183,7 @@ def image_to_byte(image):
|
|||||||
# use buffer to store pixmap into byteArray
|
# use buffer to store pixmap into byteArray
|
||||||
buffie = QtCore.QBuffer(byte_array)
|
buffie = QtCore.QBuffer(byte_array)
|
||||||
buffie.open(QtCore.QIODevice.WriteOnly)
|
buffie.open(QtCore.QIODevice.WriteOnly)
|
||||||
|
if isinstance(image, QtGui.QImage):
|
||||||
image.save(buffie, "PNG")
|
image.save(buffie, "PNG")
|
||||||
log.debug(u'image_to_byte - end')
|
log.debug(u'image_to_byte - end')
|
||||||
# convert to base64 encoding so does not get missed!
|
# convert to base64 encoding so does not get missed!
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
top: 0px;
|
top: 0px;
|
||||||
width: 100%%;
|
width: 100%%;
|
||||||
height: 100%%;
|
height: 100%%;
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<body>
|
<body>
|
||||||
|
@ -136,6 +136,7 @@ def make_sha_hash(password):
|
|||||||
"""
|
"""
|
||||||
Create an encrypted password for the given password.
|
Create an encrypted password for the given password.
|
||||||
"""
|
"""
|
||||||
|
log.debug("make_sha_hash")
|
||||||
return sha(ntob(password)).hexdigest()
|
return sha(ntob(password)).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
@ -143,6 +144,7 @@ def fetch_password(username):
|
|||||||
"""
|
"""
|
||||||
Fetch the password for a provided user.
|
Fetch the password for a provided user.
|
||||||
"""
|
"""
|
||||||
|
log.debug("Fetch Password")
|
||||||
if username != Settings().value(u'remotes/user id'):
|
if username != Settings().value(u'remotes/user id'):
|
||||||
return None
|
return None
|
||||||
return make_sha_hash(Settings().value(u'remotes/password'))
|
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.
|
Return the latest display image as a byte stream.
|
||||||
"""
|
"""
|
||||||
result = {
|
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'
|
cherrypy.response.headers['Content-Type'] = u'application/json'
|
||||||
return json.dumps({u'results': result})
|
return json.dumps({u'results': result})
|
||||||
|
Loading…
Reference in New Issue
Block a user