<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>相机 on Byte Prince</title>
    <link>https://byteprince.com/tags/%E7%9B%B8%E6%9C%BA/</link>
    <description>Recent content in 相机 on Byte Prince</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 17 Apr 2026 22:54:09 +0800</lastBuildDate><atom:link href="https://byteprince.com/tags/%E7%9B%B8%E6%9C%BA/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>给相机拍的照片批量添加GPS位置</title>
      <link>https://byteprince.com/posts/e0fe1e24/</link>
      <pubDate>Fri, 17 Apr 2026 22:54:09 +0800</pubDate>
      
      <guid>https://byteprince.com/posts/e0fe1e24/</guid>
      <description></description>
      <content:encoded><![CDATA[<p>随着近些年手机影像的飞速发展，手机（算法的 力量）已经可以覆盖大多数拍摄场景了。但是在外出旅行或者专门拍摄人像写真的时候，还是需要用到相机（光学的力量）。很可惜，目前中国大陆市面上绝大部分相机是没有提供GPS模块的（被阉割掉了），至于是什么原因，不是本文需要探讨的重点。</p>

<p>本文通过一种简易的方式，来批量为相机拍摄的照片添加GPS位置，尤其是在异地旅游的时候，能为后续整理照片提供极大的方便。</p>

<h3 id="需要用到的设备">需要用到的设备</h3>

<ul>
<li>相机拍摄的照片（因为手机拍摄的照片都自动会写入GPS信息）</li>
<li>一台电脑</li>
<li>一台手机</li>
<li>Apple Watch（可选）</li>
</ul>

<h3 id="操作步骤">操作步骤</h3>

<p>1.在iPhone上安装<code>GPX Tracker</code>，同时在Apple Watch 上也同步安装<code>GPX Tracker</code>（<a href="https://apps.apple.com/cn/app/open-gpx-tracker/id984503772">下载地址</a>）。安卓可以使用<code>geo- tracker</code>，效果类似，可以生成记录移动过程中的<code>GPX</code>文件。</p>

<p>外出的时候用手机（或者是Apple Watch）记录轨迹都可以，Apple Watch记录完轨迹后可以选择<code>GPX</code>轨迹文件，发送到手机App，手机可以再通过隔空投送很方便地传输到电脑</p>

<p>2.以笔者使用的<code>macOS</code>系统为例，因为电脑上有<code>brew</code>，所以可以很方便地安装<code>exiftool</code>。</p>

<p>将待添加GPS信息的照片和<code>GPX</code>轨迹文件放置在同一个目录下，在该目录打开终端，执行以下命令，可以批量写入GPS信息，这个命令会重新生成一份带GPS信息的图片文件，同时将原图片备份，可靠性还是很不错的。</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">exiftool -geotag xxx.gpx .</code></pre></td></tr></table>
</div>
</div>
<h3 id="参考文献">参考文献</h3>

<ul>
<li><a href="http://xhslink.com/o/H4BsYePAy8">http://xhslink.com/o/H4BsYePAy8</a></li>
<li><a href="https://clox.nu/blog/add-gps-exif-info-to-camera-photos/">https://clox.nu/blog/add-gps-exif-info-to-camera-photos/</a></li>
</ul>]]></content:encoded>
    </item>
    
  </channel>
</rss>
