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

[FTO] Refactor EXIF conditionals #663

Open
rexagod opened this issue Jun 3, 2019 · 9 comments

Comments

Projects
None yet
4 participants
@rexagod
Copy link

commented Jun 3, 2019

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.

    if (typeof GPS["GPSAltitude"] !== 'undefined' && typeof GPS["GPSAltitudeRef"] !== 'undefined'){
    // Attempt to use GPS altitude:
    // (may eventually need to find EXIF field of view for correction)
    if (typeof GPS.GPSAltitude !== 'undefined' &&
    typeof GPS.GPSAltitudeRef !== 'undefined') {

    if (GPS["Orientation"] == 6) { //CCW
    angle += (Math.PI / 180) * -90
    } else if (GPS["Orientation"] == 8) { //CW
    angle += (Math.PI / 180) * 90

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

  • 💾 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 rexagod changed the title Refactor EXIF conditionals [FTO] Refactor EXIF conditionals Jun 3, 2019

@rexagod

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

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

@gauravano

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

@rexagod

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

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

@gauravano

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

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?

@rexagod

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

@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.

@kylemumma

This comment has been minimized.

Copy link

commented Jun 4, 2019

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

@rexagod

This comment has been minimized.

Copy link
Author

commented Jun 4, 2019

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

@kylemumma

This comment has been minimized.

Copy link

commented Jun 4, 2019

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

@jywarren

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.