-1

-> C#

I want to write (and read afterward) a GPS data in an image with no GPS data already present in it!

I know this question is everywhere on internet but they didn't tell you how to write specifically in an image with EMPTY GPS information.

If you are looking forward to ask me if a write any code or tried my self, then honestly, i am trying since 5 days to do this.I tried approx. all EXIF libraries available online on codeproject.com etc. I tried using property. I tried almost everything but didn't get it. They all told you to update it, not create it.

Jamil
  • 330
  • 1
  • 6
  • 25

1 Answers1

3

exiftool Download and Information for Exiftool

ExifTool is very flexible in the formats allowed for entering GPS
coordinates. Any string containing between 1 and 3 floating point 
numbers is valid. The numbers represent degrees, 
(and optionally) minutes and seconds.
For EXIF GPS coordinates, the reference direction is specified separately 
with the EXIF:GPSLatitudeRef or EXIF:GPSLongitudeRef tag.

For XMP GPS coordinates, the reference direction is specified within the 
XMP:GPSLatitude or XMP:GPSLongitude value, with west longitudes and south 
latitudes being specified either by negative coordinate values or by ending 
the string with "W" or "S". 

Here are some examples of equivalent ways to specify a GPS latitude in both 
EXIF and XMP:

exiftool -exif:gpslatitude="42 30 0.00" -exif:gpslatituderef=S a.jpg
exiftool -exif:gpslatitude="42 deg 30.00 min" -exif:gpslatituderef=S a.jpg
exiftool -exif:gpslatitude=42.5 -exif:gpslatituderef=S a.jpg

exiftool -xmp:gpslatitude="42 30 0.00 S" a.jpg
exiftool -xmp:gpslatitude=42.50S a.jpg
exiftool -xmp:gpslatitude=-42.5 a.jpg

Similar styles may be used for longitude. ExifTool will convert any of these 
coordinate styles to the proper format for the specific tag used. 

When reading, ExifTool reports coordinates in the format

DDD deg MM' SS.SS"

where DDD is degress, MM is minutes, and SS.SS is seconds. The -n option 
may be used to change this to decimal degrees, or any arbitrary format 
may be specified with the -c option. See the application documentation 
for details. 
Nodak
  • 929
  • 1
  • 8
  • 14
  • Its really not C#, isn't it! Beside if i somehow call cmd through C#, its so damn slow. – Jamil Jun 13 '15 at 07:46
  • What's the difference between using the XMP and EXIF options? How would I know which one to write? – Michael Jan 13 '20 at 02:41