![]() ![]() ![]() ![]() ![]() I assume this exif data is pretty standard, but it is a wild world out there… It would still be nice to find a way to get a string representing the nearest known location somehow, that would help the caption be more useful. south of the equator, from other cameras, etc. I also haven't tested this on any other images, e.g. if you do this on a photo with no GPS data it will probably not handle it gracefully. I didn't build in any error handling, e.g. The speed of computing the url is only annoying when you export or click on the links though. It might be faster to outsource reading the exif data to some dedicate library, perhaps in python that would return everything you want in an easy to parse json data structure. Overall, this was easier than I expected. Since this link is bracketed, it does not show the overlay however in the org-file.Īnother vacation picture, this time with a caption. This one is a little more obvious with the zoom. If you click on it, and zoom out, you will see this is a picture of the Nāpali Coast on Kauai in Hawaii, and I was in fact out at sea when I took the picture. When I export it, it wraps the image in a tag, and puts a url in the caption to the map. If I click on the image, it opens a browser to Google maps with a pin at the spot I took it. Now, in org-mode, I see the image in an overlay, and I can toggle it on and off. So finally, here is the mysterious image. :help-echo "Click me to see where this photo is on a map." :activate-func 'iphoto-thumbnails) "iphoto" :follow ( lambda (path) (browse-url (iphoto-map-url path))) Here is the function in action, making the url. (floor (string-to-number (nth 1 longitude))) (floor (string-to-number (nth 0 longitude))) (floor (string-to-number (nth 1 latitude))) (floor (string-to-number (nth 0 latitude))) (longitude-ref (cadr (assoc "exif:GPSLongitudeRef" gps-alist)))) (s-split "," (cadr (assoc "exif:GPSLongitude" gps-alist))))) (latitude-ref (cadr (assoc "exif:GPSLatitudeRef" gps-alist))) (s-split "," (cadr (assoc "exif:GPSLatitude" gps-alist))))) (gps-alist (mapcar ( lambda (s) (s-split ": " s t)) gps-lines)) (process-lines "identify" "-verbose" fname))) ( when (s-contains? "GPS" line) (s-trim line))) ( let* ((gps-lines (-keep ( lambda (line) The degrees and minutes are integers, so we will have to deal with that later. bc is a little archaic, you have to set the scale first, which tells it how many decimal places to output. I am going to pipe this through an old unix utility called bc mostly because it is simple, and I won't have to parse it much. We have to do some algebra on the latitude and longitude which are stored as integers with a division operator. We need a little function to take an image file and generate that link. I guess that is ok for now, it adds some suspense that you have to zoom out to see where the image is in some cases. It doesn't seem possible to set the zoom in this url (at least setting the zoom doesn't do anything, and I didn't feel like trying all the other variations that are reported to sometimes work). Evidently I was moving at 4.01 in some unit I can confirm that I was at least moving, I was on a ship when I took that picture, and it was moving.Īccording to this you can make a url to a Google maps pin in satellite picture mode that looks like this: 11 6.14N,159 40 45.12W&t=k. The interpretation here is that I took that photo at latitude 22° 11' 6.14" N, and longitude 159° 40' 45.12" W. Identify -verbose IMG_1759.JPG | grep GPS ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |