Add plugin_skyline_quality option (#159)

This commit is contained in:
lowlighter
2021-02-27 12:33:35 +01:00
parent 3d61a1f683
commit b064ed1a03
4 changed files with 26 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ This uses puppeteer to generate collect image frames, and use CSS animations to
with: with:
# ... other options # ... other options
plugin_skyline: yes plugin_skyline: yes
plugin_skyline_year: 0 # Set to 0 to display current year plugin_skyline_year: 0 # Set to 0 to display current year
plugin_skyline_frames: 60 # Use 60 frames (half-loop) plugin_skyline_frames: 60 # Use 60 frames (half-loop)
plugin_skyline_quality: 0.5 # Scale-down quality by half to reduce file-size (⚠️ higher quality increase file size)
``` ```

View File

@@ -7,7 +7,7 @@
return null return null
//Load inputs //Load inputs
let {year, frames} = imports.metadata.plugins.skyline.inputs({data, account, q}) let {year, frames, quality} = imports.metadata.plugins.skyline.inputs({data, account, q})
if (Number.isNaN(year)) { if (Number.isNaN(year)) {
year = new Date().getFullYear() year = new Date().getFullYear()
console.debug(`metrics/compute/${login}/plugins > skyline > year set to ${year}`) console.debug(`metrics/compute/${login}/plugins > skyline > year set to ${year}`)
@@ -32,7 +32,7 @@
//Generate gif //Generate gif
console.debug(`metrics/compute/${login}/plugins > skyline > generating frames`) console.debug(`metrics/compute/${login}/plugins > skyline > generating frames`)
const framed = await imports.puppeteergif({page, width, height, frames, scale:0.5}) const framed = await imports.puppeteergif({page, width, height, frames, scale:quality})
//Close puppeteer //Close puppeteer
await browser.close() await browser.close()

View File

@@ -26,3 +26,12 @@ inputs:
default: 60 default: 60
min: 1 min: 1
max: 120 max: 120
# Image quality
# Note that it significantly increases output filesize (up to a few Mb) which can cause render/loading issues
plugin_skyline_quality:
description: Image quality
type: number
default: 0.5
min: 0.1
max: 1

View File

@@ -6,3 +6,14 @@
timeout: 1800000 timeout: 1800000
modes: modes:
- action - action
- name: Skyline plugin (complete)
uses: lowlighter/metrics@latest
with:
token: NOT_NEEDED
plugin_skyline: yes
plugin_skyline_frames: 12
plugin_skyline_quality: 0.7
timeout: 1800000
modes:
- action