在没有先前 GPS 数据的简单图像文件中写入 GPS 数据

Writing GPS data in a simple image file WITH NO PREVIOUS GPS data in it

-> C#

我想在图像中写入(然后读取)GPS 数据,其中没有 GPS 数据!

我知道这个问题在互联网上到处都是,但他们没有告诉你如何在带有 EMPTY GPS 信息的图像中具体写入。

如果您期待着问我是否编写任何代码或尝试过我自己,那么老实说,我已经尝试了 5 天 this.I 尝试了大约。 codeproject.com 等网上可用的所有 EXIF 库。我尝试使用 属性。我几乎尝试了一切,但没有得到它。他们都告诉你更新它,而不是创建它。

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.