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

Added a function to sequencer and then made the functionality available to crop and overlay module. #592

Merged
merged 10 commits into from
Jan 4, 2019

Conversation

Divy123
Copy link
Member

@Divy123 Divy123 commented Jan 2, 2019

Fixes #353

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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!

Mridul97 and others added 6 commits October 26, 2018 13:58
* 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.
@Divy123
Copy link
Member Author

Divy123 commented Jan 2, 2019

@tech4GT please review.

@@ -20,6 +20,31 @@ ImageSequencer = function ImageSequencer(options) {
}
}

function parseInputCoordinates(coord, callback) {
Copy link
Member

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?

@@ -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);
Copy link
Member

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?

Copy link
Member

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!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @jywarren . 😄

@Divy123
Copy link
Member Author

Divy123 commented Jan 3, 2019

@jywarren I have made the changes . Please review.

@@ -0,0 +1,24 @@
module.exports = function parseCornerCoordinateInputs(options,coord,callback) {
Copy link
Member

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:

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();
} });
});

Copy link
Member Author

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.

@jywarren
Copy link
Member

jywarren commented Jan 3, 2019 via email

@Divy123
Copy link
Member Author

Divy123 commented Jan 4, 2019

@jywarren I have made a unit test. Please review.

Copy link
Member

@jywarren jywarren left a 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?

@Divy123
Copy link
Member Author

Divy123 commented Jan 4, 2019

@jywarren Test file moved to /test/utils. Please review.

@jywarren jywarren merged commit aad1f82 into publiclab:main Jan 4, 2019
@jywarren
Copy link
Member

jywarren commented Jan 4, 2019

Great!!!!

jywarren pushed a commit that referenced this pull request Jan 4, 2019
* 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
jywarren pushed a commit that referenced this pull request Jan 4, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants