Skip to content

Commit

Permalink
Merge branch 'main' of github.com:paulypeter/photography-toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
paulypeter committed Jun 14, 2021
2 parents 789ec98 + 65b0131 commit eb88711
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contribution guidelines

The standard contribution workflow applies here:

1. Create an [Issue](https://github.com/paulypeter/photography-toolbox/issues/new/choose) detailing the bug you found or your feature request.

If you want to implement or fix it yourself:

2. Ask to be the assignee for your created issue.
3. Fork the repository to your account.
4. Create a new branch for your implementation.
5. Implement the fix or feature. *
6. Commit and push your changes to your repository.
7. Create a [Pull Request](https://github.com/paulypeter/photography-toolbox/compare).

\* If you implement a new feature, add tests for it.
3 changes: 3 additions & 0 deletions src/exposure.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ f_stop_for_ev = (ev, shutter_speed, iso_speed = 100) => {
}

find_nearest = (setting, value) => {
if (setting.includes("1/8000") && value > 35) {
return Math.round(value)
}
if (setting.indexOf(get_str_from_speed_float(value)) > -1) {
return get_str_from_speed_float(value)
}
Expand Down
5 changes: 5 additions & 0 deletions test/exposure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ test("Returns correct closest speed setting", () => {
photographyTools.SHUTTER_SPEEDS, 35
)
).toBe("30");
expect(
photographyTools.find_nearest(
photographyTools.SHUTTER_SPEEDS, 60.12312
)
).toBe(60);
expect(
photographyTools.find_nearest(
photographyTools.SHUTTER_SPEEDS, 0.005
Expand Down

0 comments on commit eb88711

Please sign in to comment.