-
Notifications
You must be signed in to change notification settings - Fork 209
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
Added a function to sequencer and then made the functionality available to crop and overlay module. #592
Conversation
* Add manifest.json * cache static assets for offline use * update cache * add meta theme-color and change static files to be cache * cache the files on network request * caching on first run Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add a button to clear cache * add styling to clear cache link
I've arranged the modules in alphabetical order.
…ty for crop and overlay modules
This reverts commit dbda25a.
@tech4GT please review. |
src/ImageSequencer.js
Outdated
@@ -20,6 +20,31 @@ ImageSequencer = function ImageSequencer(options) { | |||
} | |||
} | |||
|
|||
function parseInputCoordinates(coord, callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, this is really nice! but perhaps a slightly more descriptive function name? What precisely does it do - parseCornerCoordinateInputs
?
src/modules/Crop/Module.js
Outdated
@@ -29,8 +29,23 @@ module.exports = function CropModule(options, UI) { | |||
// save the input image; | |||
// TODO: this should be moved to module API to persist the input image | |||
options.step.input = input.src; | |||
var sequencer = require('../../ImageSequencer.js')(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, we should perhaps try to make this available in a standalone utility file, so in https://github.com/publiclab/image-sequencer/tree/main/src/util, and then directly require it from there, instead of having to instantiate a complete new sequencer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe as https://github.com/publiclab/image-sequencer/tree/main/src/util/parseInputCoordinates.js
or whatever you name it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @jywarren . 😄
@jywarren I have made the changes . Please review. |
@@ -0,0 +1,24 @@ | |||
module.exports = function parseCornerCoordinateInputs(options,coord,callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Now do you think we might make a unit test for this function, where we also describe what it does using a sentence? This could be quite simple, like this test:
image-sequencer/test/modules/replace.js
Lines 17 to 25 in 6028520
test('replaceImage works.', function (t){ | |
if (typeof(document) === "undefined") | |
t.end(); | |
sequencer.replaceImage("img","invert",{ callback: function(){ | |
t.equal(0,0, "replaceImage works"); | |
t.end(); | |
} }); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure @jywarren . Will love doing that.
:-)))))
…On Thu, Jan 3, 2019 at 3:29 PM Slytherin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/util/ParseInputCoordinates.js
<#592 (comment)>
:
> @@ -0,0 +1,24 @@
+module.exports = function parseCornerCoordinateInputs(options,coord,callback) {
Sure @jywarren <https://github.com/jywarren> . Will love doing that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#592 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJwRobAjjwoSWk6E7aFMNwDbWQk32ks5u_mgGgaJpZM4ZnB8o>
.
|
@jywarren I have made a unit test. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Can we put the test in /test/util?
@jywarren Test file moved to /test/utils. Please review. |
Great!!!! |
* updated drop down * fixed greyscale (#593) * add local to locally stored modules (#596) * Add drawing rectangles module (#566) * add drawing rectangle module * changes * White balance module (#585) * white baalance module * improved algorithm * limit check * Ability to set background color when "over cropping" to enlarge canvas (#563) * ability to set background color when over cropping to enlarge canvas * changes * Clarify that saved sequence will only be available in this browser (#587) * clarify that saved sequence will only be available in this browser * changes * changes * changes * Added a function to sequencer and then made the functionality available to crop and overlay module. (#592) * Add manifest.json and cache static assets for offline use (#331) * Add manifest.json * cache static assets for offline use * update cache * add meta theme-color and change static files to be cache * cache the files on network request * caching on first run Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add a button to clear cache * add styling to clear cache link * Update Modules.js (#452) I've arranged the modules in alphabetical order. * Added a function to parse Input coordinates and added the functionality for crop and overlay modules * Added changed dist files * Revert "Added changed dist files" This reverts commit dbda25a. * Changed function name and added the functionaity to src/utils folder * Added unit test * Added unit test to /test/util * Add border thickness and color in DrawRectangle module (#602) * added border thickness functionality * add color functionality
* fixed fastie * fixed greyscale (#593) * add local to locally stored modules (#596) * Add drawing rectangles module (#566) * add drawing rectangle module * changes * White balance module (#585) * white baalance module * improved algorithm * limit check * Ability to set background color when "over cropping" to enlarge canvas (#563) * ability to set background color when over cropping to enlarge canvas * changes * Clarify that saved sequence will only be available in this browser (#587) * clarify that saved sequence will only be available in this browser * changes * changes * changes * Added a function to sequencer and then made the functionality available to crop and overlay module. (#592) * Add manifest.json and cache static assets for offline use (#331) * Add manifest.json * cache static assets for offline use * update cache * add meta theme-color and change static files to be cache * cache the files on network request * caching on first run Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add a button to clear cache * add styling to clear cache link * Update Modules.js (#452) I've arranged the modules in alphabetical order. * Added a function to parse Input coordinates and added the functionality for crop and overlay modules * Added changed dist files * Revert "Added changed dist files" This reverts commit dbda25a. * Changed function name and added the functionaity to src/utils folder * Added unit test * Added unit test to /test/util * Add border thickness and color in DrawRectangle module (#602) * added border thickness functionality * add color functionality * Bump tape from 4.9.1 to 4.9.2 (#579) Bumps [tape](https://github.com/substack/tape) from 4.9.1 to 4.9.2. - [Release notes](https://github.com/substack/tape/releases) - [Commits](tape-testing/tape@v4.9.1...v4.9.2) Signed-off-by: dependabot[bot] <support@dependabot.com> * Bump looks-same from 4.1.0 to 5.0.1 (#559) Bumps [looks-same](https://github.com/gemini-testing/looks-same) from 4.1.0 to 5.0.1. - [Release notes](https://github.com/gemini-testing/looks-same/releases) - [Changelog](https://github.com/gemini-testing/looks-same/blob/master/CHANGELOG.md) - [Commits](gemini-testing/looks-same@v4.1.0...v5.0.1) Signed-off-by: dependabot[bot] <support@dependabot.com> * Bump jsqr from 0.2.2 to 1.1.1 (#532) Bumps [jsqr](https://github.com/cozmo/jsQR) from 0.2.2 to 1.1.1. - [Release notes](https://github.com/cozmo/jsQR/releases) - [Commits](https://github.com/cozmo/jsQR/commits) Signed-off-by: dependabot[bot] <support@dependabot.com> * Update color drop down (#595) * updated drop down * fixed greyscale (#593) * add local to locally stored modules (#596) * Add drawing rectangles module (#566) * add drawing rectangle module * changes * White balance module (#585) * white baalance module * improved algorithm * limit check * Ability to set background color when "over cropping" to enlarge canvas (#563) * ability to set background color when over cropping to enlarge canvas * changes * Clarify that saved sequence will only be available in this browser (#587) * clarify that saved sequence will only be available in this browser * changes * changes * changes * Added a function to sequencer and then made the functionality available to crop and overlay module. (#592) * Add manifest.json and cache static assets for offline use (#331) * Add manifest.json * cache static assets for offline use * update cache * add meta theme-color and change static files to be cache * cache the files on network request * caching on first run Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add a button to clear cache * add styling to clear cache link * Update Modules.js (#452) I've arranged the modules in alphabetical order. * Added a function to parse Input coordinates and added the functionality for crop and overlay modules * Added changed dist files * Revert "Added changed dist files" This reverts commit dbda25a. * Changed function name and added the functionaity to src/utils folder * Added unit test * Added unit test to /test/util * Add border thickness and color in DrawRectangle module (#602) * added border thickness functionality * add color functionality * rebuild
Fixes #353
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Thanks!