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: 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)
|
||||||
```
|
```
|
||||||
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user