Giter VIP home page Giter VIP logo

Comments (3)

jmathai avatar jmathai commented on August 21, 2024

key is set based on the value of type earlier on line 66.

key = self.exif_map['longitude'] if type == 'longitude' else self.exif_map['latitude']

from elodie.

zserg avatar zserg commented on August 21, 2024

The image 'with-location-inv.jpg' have the сoordinates inverted relative to 'with-location.jpg'. Tests added was failed. zserg/elodie@ea04b77

The following fix made test passed: zserg/elodie@95923e7

from elodie.

jmathai avatar jmathai commented on August 21, 2024

@zserg You're correct. Thanks for commenting despite me closing the issue. Do you mind opening a PR? I would suggest this additional change to make the code more readable. We should use type when we can and key for when we need the exivpy2 attribute name.

--- a/elodie/media/photo.py
+++ b/elodie/media/photo.py
@@ -72,14 +72,14 @@ class Photo(Media):
         try:
             # this is a hack to get the proper direction by negating the values for S and W
             latdir = 1
-            if(key == self.exif_map['latitude'] and str(exif[self.exif_map['latitude_ref']].value) == 'S'):
+            if(type == 'latitude' and str(exif[self.exif_map['latitude_ref']].value) == 'S'):
                 latdir = -1
             londir = 1
-            if(key == self.exif_map['longitude'] and str(exif[self.exif_map['longitude_ref']].value) == 'W'):
+            if(type == 'longitude' and str(exif[self.exif_map['longitude_ref']].value) == 'W'):
                 londir = -1

from elodie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.