Add plugin_skyline_quality option (#159)
This commit is contained in:
@@ -24,4 +24,5 @@ This uses puppeteer to generate collect image frames, and use CSS animations to
|
||||
plugin_skyline: yes
|
||||
plugin_skyline_year: 0 # Set to 0 to display current year
|
||||
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)
|
||||
```
|
||||
@@ -7,7 +7,7 @@
|
||||
return null
|
||||
|
||||
//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)) {
|
||||
year = new Date().getFullYear()
|
||||
console.debug(`metrics/compute/${login}/plugins > skyline > year set to ${year}`)
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
//Generate gif
|
||||
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
|
||||
await browser.close()
|
||||
|
||||
@@ -26,3 +26,12 @@ inputs:
|
||||
default: 60
|
||||
min: 1
|
||||
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
|
||||
@@ -6,3 +6,14 @@
|
||||
timeout: 1800000
|
||||
modes:
|
||||
- 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
|
||||
|
||||
Reference in New Issue
Block a user