mapknitter icon indicating copy to clipboard operation
mapknitter copied to clipboard

[FTO] Refactor EXIF conditionals

Open rexagod opened this issue 5 years ago • 10 comments

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • [ ] 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

  • [ ] 📝 Update the below conditionals according to proper logic, i.e., remove redundant if-elsees, or use 'or' || operators to combine them if their logic is identical. https://github.com/publiclab/mapknitter/blob/cc7e9242f559ee53b581f94c8b43adfcc8c28229/app/assets/javascripts/mapknitter/Map.js#L328-L332 https://github.com/publiclab/mapknitter/blob/cc7e9242f559ee53b581f94c8b43adfcc8c28229/app/assets/javascripts/mapknitter/Map.js#L319-L322 https://github.com/publiclab/mapknitter/blob/cc7e9242f559ee53b581f94c8b43adfcc8c28229/app/assets/javascripts/mapknitter/Map.js#L308-L312

  • [ ] 💾 Commit your changes

  • [ ] 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • [ ] 🏁 Done Ask in comments for a review :)

🤔❓ Questions?

Leave a comment below!

Is someone else already working on this?

We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. If someone seem stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

(This issue was created by First-Timers-Bot.)

rexagod avatar Jun 03 '19 21:06 rexagod

@gauravano Can you give this a FTO label? Thanks!

rexagod avatar Jun 03 '19 21:06 rexagod

Sure! Also, would you like to have some more permissions on this repository like labeling, editing issues, unstable use, etc?

grvsachdeva avatar Jun 03 '19 22:06 grvsachdeva

Considering the fact that my project has to finally be integrated here (from LDI), I guess this will make things a lot more easier! Thanks, @gauravano!👍

rexagod avatar Jun 03 '19 23:06 rexagod

Do you have special permission in image sequencer and leaflet blurred location as we may need to change permission for other repos to "write" here - https://github.com/orgs/publiclab/teams/soc/repositories?

grvsachdeva avatar Jun 04 '19 00:06 grvsachdeva

@gauravano I do have special permissions (read, label, edit issues) for image-sequencer and lbl repos, but please go ahead with this only if it seems convenient and okay to you, in any case, I'm fine with pinging with you (or others with special permissions) for minor tasks, if I don't get special permissions at the moment for any reason, whatever that may be.

rexagod avatar Jun 04 '19 11:06 rexagod

It doesn't look like anybody else has claimed this issue, can I take it?

kylemumma avatar Jun 04 '19 15:06 kylemumma

Hey, @kylemumma! Go ahead, and let us know if you need help with anything!

rexagod avatar Jun 04 '19 19:06 rexagod

Hi @rexagod I was not able to edit the code in the browser so I forked the repo and cloned it like in the tutorials. I was reading the readme.md and saw installation instructions with prerequisites but was not able to follow it, i'm not sure if I need to or not. This is what I changed the code to:

first code block

if (typeof GPS["GPSAltitude"] !== 'undefined' && typeof GPS["GPSAltitudeRef"] !== 'undefined'){

I wasn't sure about the second code block, it seems as though the current if statement is fine but this is what I came up with to change it to

if (GPS["Orientation"] == 6 || GPS["Orientation"] == 8) { //CCW
  radiansOfRotation = Math.PI / 2;
  GPS["Orientation"] == 6 ? angle -= radiansOfRotation : angle += radiansOfRotaion;

third code block

if (GPS["GPSImgDirectionRef"] == "T" || GPS["GPSImgDirectionRef"] == "M")
   angle = (Math.PI / 180) * (GPS.GPSImgDirection["numerator"]/GPS.GPSImgDirection["denominator"] - 90);

I am not sure how to run the app and test to make sure my code is working, i've never worked with rails before

kylemumma avatar Jun 04 '19 21:06 kylemumma

I tweaked the permissions, giving write to the soc team on all but plots2 and distortableImage... where i gave triage. But with protected branches I think we could do write on all... what do you think?

jywarren avatar Jun 05 '19 20:06 jywarren

Hi @rexagod, can i claim this issue?

fchatterji avatar Feb 06 '23 18:02 fchatterji