Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Average module editing the UI from the source #1469

Merged
merged 10 commits into from
Jan 16, 2020
4 changes: 2 additions & 2 deletions src/modules/Average/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ module.exports = function Average(options, UI) {
// report back and store average in metadata:
options.step.metadata.averages = sum;

// TODO: refactor into a new "display()" method as per https://github.com/publiclab/image-sequencer/issues/242
if (options.step.inBrowser && options.step.ui) $(options.step.ui).find('.details').append('<p><b>Averages</b> (r, g, b, a): ' + sum.join(', ') + '</p>');
root00198 marked this conversation as resolved.
Show resolved Hide resolved
if(options.step.average === undefined) options.step.average = '';
root00198 marked this conversation as resolved.
Show resolved Hide resolved
options.step.average += 'rgba(' + sum.join(', ') + ')';
return pixels;
}

Expand Down
6 changes: 6 additions & 0 deletions src/modules/Average/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"description": "Average all pixel color",
"inputs": {
},
"outputs": {
"average": {
"type": "string",
"desc": "The average value of all the pixels."
}
},
"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#average-module"
}