I do not believe Image Events is able to get that type of meta data from the photo however mdls
can do it, e.g. mdls -name kMDItemLatitude -name kMDItemLongitude /path/to/photo
however it all depends what exactly your trying to do with this info. I personally prefer using exiftool
however you'd have to install it.
To answer the question in your comment:
If you query an attributeName
when using -raw
and the attributeName
doesn't exist the output is literally (null)
and if you want it to be something else then use −nullMarker markerString
, e.g.: −nullMarker "Does Not Exist"
mdls -name kMDItemFake -raw -nullMarker "Does Not Exist" /path/to/photo
In the example command above kMDItemFake
is a fake kMDItem
item, so that command will output: Does Not Exist
instead of (null)
.
In other words, if as example the photo doesn't have kMDItemLatitude
info and you query for it the output will be (null)
when using mdls -name kMDItemLatitude -raw
. To change that, use −nullMarker markerString
.
If a kMDItem
doesn't exist and you want no output when using mdls -name attar -raw
then use mdls -name attar -raw −nullMarker '' /path/to/photo
.
mdls
can do it, e.g.mdls -name kMDItemLatitude -name kMDItemLongitude /path/to/photo
however it all depends what exactly your trying to do with this info. I personally prefer usingexiftool
however you'd have to install it. If you'd provide more information about what your trying to do and be a bit more explicit and specific it would be easier to write up and answer.-nullMarker
option (it doesn’t seem t work for me, even when I use theraw
option), or whether there is an alternative for RAW files, that would be a bonus. Otherwise, it’s good.