From 1906a269997ddb04e22dd26bb88e083e2da92754 Mon Sep 17 00:00:00 2001 From: paulypeter Date: Sun, 13 Jun 2021 15:03:20 +0200 Subject: [PATCH 1/2] Create CONTRIBUTING.md --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..afc0d24 --- /dev/null +++ b/CONTRIBUTING.md @@ -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. From b6427fac43f0cca68ed48d43704cd8f5c1117fca Mon Sep 17 00:00:00 2001 From: Peter Pauly Date: Mon, 14 Jun 2021 12:02:39 +0200 Subject: [PATCH 2/2] implements better return for shutter speeds > 30 --- src/exposure.js | 3 +++ test/exposure.test.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/exposure.js b/src/exposure.js index 9aa6452..a90b7ec 100644 --- a/src/exposure.js +++ b/src/exposure.js @@ -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) } diff --git a/test/exposure.test.js b/test/exposure.test.js index 768bd5f..b959cc2 100644 --- a/test/exposure.test.js +++ b/test/exposure.test.js @@ -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