Comments (8)
Good question. I have to admit I'm not sure why that is...
I thought maybe it was using XMP information, but the file has none:
> ~/work/oss/exif-py/EXIF.py -dc 0c824ff0-aef6-11e4-8966-5aeb5f0dfc7f.JPG
....
DEBUG XMP not in Exif, searching file for XMP info ...
DEBUG XMP Finished searching for info
....
I then checked with the popular exif tool and got the same result as with this library:
> exif 0c824ff0-aef6-11e4-8966-5aeb5f0dfc7f.JPG
EXIF tags in '0c824ff0-aef6-11e4-8966-5aeb5f0dfc7f.JPG' ('Motorola' byte order):
.....
Latitude |31, 27, 21,47
....
from exif-py.
Hmm... anything else I can do to help figure this out? Would more photos help?
from exif-py.
What could be interesting is to compare an image not taken with Apple hardware and see if there is the same discrepency.
Maybe there is some sort of proprietary info not present in the Exif?
from exif-py.
Perhaps Preview is reading the same coordinate values, converting to decimal for internal manipulation, then converting back to DMS for the info panel display? That, along with some rounding and false precision might account for the discrepancy.
from exif-py.
Good point. For all we know, OSX's Preview could be the one reporting a wrong value.
from exif-py.
It appeared to be more accurate for the photos I tested it with.
from exif-py.
The difference is 0.002", which is roughly 50cm.
But the best GPS receptors' accuracy is about 3 to 5 meters, which translates to 0.01" to 0.02".
So whatever the different software say, one thing is true for sure: the GPS receptor only provided at best 2-digit precision, so OSX Preview is wrong to display more than that.
Now, where it gets them from? My bet is it computes the latitude using decimal latitude. That is, it internally converts [31, 27, 2147/100]
into a decimal number such as 31.45596388888889
. This is a very common thing to do, as having just one number for latitude is much more convenient than having an array of 4 numbers.
The problem is, such numbers cannot be perfectly represented as decimals, let alone as floats. So, you just get an approximation. For instance, the closest number to 31.455963888888889
that can be actually represented using a float
is 31.455963134765625
. You can test that yourself by writing a short C program.
Because of this, when converting the value back into DMS for display, you will not get the original value back, just something close to it. For instance, 31° 27' 21.46839230493
.
You then round it for display. Round it to 2 digits, you get 21.47
. Round it to 4 digits, you get 21.4684
, of which the last 2 digits actually are meaningless garbage.
=> Round it to 3 digits and you get 21.468
, that is 21.47
with a -0.002
error caused by conversion approximations.
I might be wrong. Maybe Apple somehow reinvented GPS without telling anyone and is storing extra information in some hidden place in the image. But it seems much more plausible the difference you see means nothing more than "OSX Preview internally uses floats to manipulate the latitude".
from exif-py.
Seems logical, I think we can close this one now. Thanks all.
from exif-py.
Related Issues (20)
- EXIF from this HEIF cannot be read
- EXIF UserComment tag is not being read HOT 1
- Modify exif data HOT 1
- HEIC parser reaches EOF inside `get32()` call HOT 1
- struct.error: unpack requires a buffer of 8 bytes HOT 3
- Assertion error when reading from HEIC file rotated by the Windows Photos app
- Unexpected/unhandled segment type or file content: possibly incomplete read of data
- IdfTag.__str__() returns a list
- Any Documentation for exifread?
- KeyError: hdlr HOT 5
- infinite loop for one rare image HOT 1
- can't read EXIF 0220 or EXIF 0221 version GPS information
- Many useless warnings HOT 2
- str/bytes problems
- exifread return incorrect value HOT 1
- Error: int too big to convert
- Corrupted image causes huge resource consumption HOT 1
- exifread.heic.NoParser: hdlr HOT 1
- KeyError 'E' in process_file HOT 1
- exifread returns empty dict
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exif-py.