mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Systemd changes | root script | URL support for gif effects (#1319)
* Systemd changes and URL option for Gif Effects * Add grayscale to gif effect * WebUI adjustments * Rename version to .version * Copy runHyperionAsRoot.sh to rpi packages * Pack script into all unix packages * Start hyperion only after network is available * Snap builds removed due to poor server connection * Flexible updateHyperionUser.sh * updateHyperionUser script entered in the package * Print help on none sudo execute * Corrected embedded Python location * Replacement for the QWindowsScreen grabWindow function * Updated to latest 2.x mbedtls version 2.27 Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
This commit is contained in:
@@ -1,18 +1,27 @@
|
||||
import hyperion, time
|
||||
|
||||
# Get the parameters
|
||||
imageFile = hyperion.args.get('image')
|
||||
imageData = hyperion.args.get('url') if hyperion.args.get('imageSource', "") == "url" else hyperion.args.get('file')
|
||||
framesPerSecond = float(hyperion.args.get('fps', 25))
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
reverse = bool(hyperion.args.get('reverse', False))
|
||||
cropLeft = int(hyperion.args.get('cropLeft', 0))
|
||||
cropTop = int(hyperion.args.get('cropTop', 0))
|
||||
cropRight = int(hyperion.args.get('cropRight', 0))
|
||||
cropBottom = int(hyperion.args.get('cropBottom', 0))
|
||||
grayscale = bool(hyperion.args.get('grayscale', False))
|
||||
|
||||
sleepTime = 1./framesPerSecond
|
||||
imageList = []
|
||||
imageFrameList = []
|
||||
|
||||
if imageFile:
|
||||
imageList = [reversed(hyperion.getImage(imageFile))] if reverse else hyperion.getImage(imageFile)
|
||||
if imageData:
|
||||
if reverse:
|
||||
imageFrameList = reversed(hyperion.getImage(imageData, cropLeft, cropTop, cropRight, cropBottom, grayscale))
|
||||
else:
|
||||
imageFrameList = hyperion.getImage(imageData, cropLeft, cropTop, cropRight, cropBottom, grayscale)
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort() and imageList:
|
||||
for image in imageList:
|
||||
hyperion.setImage(image["imageWidth"], image["imageHeight"], image["imageData"])
|
||||
time.sleep(sleepTime)
|
||||
while not hyperion.abort() and imageFrameList:
|
||||
for image in imageFrameList:
|
||||
if not hyperion.abort():
|
||||
hyperion.setImage(image["imageWidth"], image["imageHeight"], image["imageData"])
|
||||
time.sleep(sleepTime)
|
||||
|
Reference in New Issue
Block a user