A cross-platform tool for embedding GPS data into photographs

Overview

nya-exif

中文 | English

GitHub release (with filter)

介绍

nya-exif 是一个用于匹配照片 GPS 信息, 并写入文件 EXIF 信息的工具, 支持 JPEG 和 PNG 及各大相机厂商的主流RAW格式. 本工具基于 Rust 编写, 支持全平台使用

Features

  • 支持 JPEG 和 PNG 及各大相机厂商的主流RAW格式
  • 全平台支持
  • 支持国策局 GCJ-02 和 WGS-84 坐标系 (解决国内坐标漂移问题)
  • 自动检测国内外位置, 自动转换为对应坐标系
  • 支持多线程处理

DEMO

➜  nya-exif /path/to/image/folder/
2023-11-11 12:46:08.337698000 [INFO] <nya_exif::core::app:130>:[20230908-_MGL4100.JPG] Location updated, lat: 34.7737885, lon: 131.9007701
2023-11-11 12:46:08.394225000 [INFO] <nya_exif::core::app:130>:[20230908-_MGL4114.JPG] Location updated, lat: 34.67844170666667, lon: 131.83647663733333
2023-11-11 12:46:08.434180000 [INFO] <nya_exif::core::app:130>:[20230908-_MGL4128.JPG] Location updated, lat: 34.68192337279844, lon: 131.8327970596869
⠉ [00:00:03] [###########################>-----------------------------------------------]      54/77      (1.8s)
⠉ [00:00:03] [###########################>-----------------------------------------------]      55/77      (1.6s)
⠉ [00:00:03] [#############################>---------------------------------------------]      60/79      (1.4s)

使用

确保已安装 ExifTool, 并添加至 PATH

# macOS 下, 一生足迹启动 iCloud 云备份, 可直接运行
nya-exif .

# 其他平台下, 需要将一生足迹数据目录拷贝至本地
nya-exif -f /path/to/life-path/data /path/to/images

# 若 ExifTool 安装路径不在 PATH 中, 手动指定可执行文件位置
nya-exif -b /path/to/exiftool /path/to/images

# 指定目标坐标系, 默认为自动检测, 如果在边境线附近需要手动指定
nya-exif -c wgs84 /path/to/images

Note

推荐在本地文件上运行程序, 若在网络盘上运行, 会影响程序速度

ExifWriter/LocationReader 支持情况

Exif Writer 描述
ExifTool 支持大多数图片文件的EXIF信息读写, 全平台支持
安装: 官网下载对应平台安装包, 直接安装即可, 添加至PATH后本工具会自动查找程序路径; 若未添加到 PATH, 需要手动指定 -b 选项到程序的二进制文件绝对路径
Location Reader 描述
一生足迹 一生足迹是一款 iOS 端记录用户足迹的应用, 耗电量较低, 可常驻后台
安装: App Store下载安装即可, 需要开启 iCloud 同步
使用: 对于 macOS 用户, 程序会自动查找一生足迹在 iCloud 中的备份位置; 对于其他平台用户, 需要手动指定目录(含backUpData.csv文件)的位置
注意: 该备份文件的同步不是很及时, 如果拍摄时间较新需要在 App 中手动到处数据文件加载

目前程序默认选项为 ExifTool + 一生足迹, 在 macOS 平台安装 ExifTool.pkg 后可直接使用默认参数启动工具

命令行参数

Usage: nya-exif [OPTIONS] [PATH]

Arguments:
  [PATH]
          Path to photography files

Options:
  -r, --recursive
          Turn on recursive mode

  -x, --threads <THREADS>
          Threads
          
          Number of threads to use.
          
          [default: 3]
          
  -w, --writer-type <WRITER_TYPE>
          Exif writer type
          
          [default: exiftool]

          Possible values:
          - exiftool: ExitTool(https://exiftool.org/)

  -b, --writer-bin-path <WRITER_BIN_PATH>
          Exif writer binary path
          
          Path to the exif writer binary.
          
          Leave it blank for the program to search automatically.

  -l, --location-reader-type <LOCATION_READER_TYPE>
          Location reader type
          
          LiftPath(一生足迹): https://apps.apple.com/us/app/footprint-record-lifes-path/id1225520399 On MacOS, the program will automatically search for Lifetime Footprint data in the user's iCloud directory. In systems other than MacOS, you need to manually specify the directory.
          
          [default: life-path]

          Possible values:
          - life-path: LifePath(一生足迹)

  -f, --location-file-path <LOCATION_FILE_PATH>
          Location file path
          
          The corresponding location reader's data directory path. Leave it blank for the program to search automatically.

  -i, --location-max-interval <LOCATION_MAX_INTERVAL>
          Location max interval in seconds
          
          Specifies the maximum time interval for location data near the photo time.
          
          If the difference between the timestamp of the location data and the photo exceeds this value, the location data will not be written.
          
          [default: 600]

  -c, --location-coordinate-target <LOCATION_COORDINATE_TARGET>
          Location GPS coordinate convert target
          
          Specifies the target coordinate system for converting GPS coordinates. Default is Auto-detect.

          Possible values:
          - wgs84: Global coordinate system
          - gcj02: China coordinate system

  -o, --overwrite-original
          Overwrite original file

  -t, --time-offset <TIME_OFFSET>
          Time offset in seconds
          
          Used for situations where the camera time is inconsistent with real time.
          
          E.g. the camera time is 1 hour ahead of real time, then fill in 3600 here.
          
          [default: 0]

  -d, --debug
          Turn on debug mode

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Contributing

若有其他的位置记录软件需要支持, 欢迎提交 PR 或附上详细数据信息提交 Issue

若遇到 ExifTool 无法处理的文件, 请附上文件信息提交 Issue

对于 ExifWriter 和 LocationReader, 请参考 src/exif_writersrc/location_reader 目录下已有的实现, 实现对应的 Trait 后在 src/core/app.rs 中注册即可

Important

Location Reader返回的经纬度应该为地球坐标系(WGS84), 本工具会根据用户选择的坐标系进行转换

Declaimer

本工具中附带的 GCJ-02 范围数据仅用于粗略地理位置判断, 不具有任何立场和政治倾向, 请勿用于其他用途

License

MIT ©Lyn

You might also like...
Signed distance field font and image command line tool based on OpenCL.

SDFTool Signed distance field font and image command line tool based on OpenCL. Build Windows Run cargo build --release in Visual Studio developer x64

A support tool for creating shaders that display pixel arts.

dot2shader -- PRE-BUILD PAGE IS HERE -- A tool for generating shaders displaying pixel art textures in Shadertoy and twigl. Quick start Go to pre-bu

Focus Annotator - a tool for annotation the focal plane of a part of an image
Focus Annotator - a tool for annotation the focal plane of a part of an image

Focus Annotator Focus Annotator is a tool for annotation the focal plane of a part of an image. It is a tool I built in rust as part of my master's th

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs

localbang Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs What are "bangs"?? Bangs are a way to define where to search inside

Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.
Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs.

blockoli 🥦🔎 Blockoli is a high-performance tool for code indexing, embedding generation and semantic search tool for use with LLMs. blockoli is buil

An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.
An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.

🕊️ Bevy Shell - Template An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform

Rust crate for embedding, manipulating and retrieving data embedded in binaries using linker sections

linkstore is a library that allows you to define global variables in your final compiled binary that can be modified post-compilation.

Rust read/write support for GPS Exchange Format (GPX)

gpx gpx is a library for reading and writing GPX (GPS Exchange Format) files. It uses the primitives provided by geo-types to allow for storage of GPS

Rust read/write support for GPS Exchange Format (GPX)

gpx gpx is a library for reading and writing GPX (GPS Exchange Format) files. It uses the primitives provided by geo-types to allow for storage of GPS

Retrieving SSH and GPS keys from GitHub and GitLab

Dormarch Retrieving SSH and GPS keys from GitHub and GitLab Usage After having installed Dormarch, you can see all the options with dormarch -h. To re

Small program which groups images based on the GPS position.

gps-cluster This small program will take some pictures in input, and based on the metadata on every image, it will group them by their GPS position, i

A program to share a TTY like a GPS UART between 2 processes.

TTYTEE - A process that exposes 2 copies of the same TTY. The initial use case for this crate has been sharing a single GPS device talking through an

Built on the Substrate-based runtime, this repository develops the Paralink Network, a cross-chain Oracle platform for secure and scalable data integration. Our goal is to create a robust infrastructure that ensures efficient and reliable data transmission across blockchain networks.
Embedding Rust in Java

Java/Rust Example An example project showing how to call into Rust code from Java. OSX Linux Windows Requirements Java 7+ Rust (tested with 1.0, night

Cloudflare worker for embedding polls anywhere.

poll.fizzy.wtf Cloudflare worker for embedding polls anywhere. 🍕 Pineapple on pizza? 🍍 Yes 👍 No 👎 Total Features Unlimited polls and unlimited opt

Lunatic based webserver embedding WASM. Supports scaling down to zero and up to infinity.

Frenezulo A WASM-embedding webserver build on top of submillisecond and lunatic. Build to serve as an entry point for microservices compiled to WASM.

Python library for embedding large graphs in 2D space, using force-directed layouts.

Graph Force A python/rust library for embedding graphs in 2D space, using force-directed layouts. Installation pip install graph_force Usage The first

A tiny embedding database in pure Rust.

tinyvector - a tiny embedding database in pure Rust ✨ Features Tiny: It's in the name. It's literally just an axum server. Extremely easy to customize

Comments
  • execution paniced

    execution paniced

    This is an excellent tool for me. I downloaded the lifepath app yesterday and exported the data to my mac path ~/Downloads A panic occurred when executing this program:

    nya-exif -f ~/Downloads . thread 'thread '<unnamed><unnamed>' panicked at src/location_reader/life_path.rs:124:40: index out of bounds: the len is 18 but the index is 18446744073709551615 note: run withRUST_BACKTRACE=1environment variable to display a backtrace ' panicked at src/location_reader/life_path.rs:124:40: index out of bounds: the len is 18 but the index is 18446744073709551615 thread '<unnamed>' panicked at src/location_reader/life_path.rs:124:40: index out of bounds: the len is 18 but the index is 18446744073709551615 23-12-21 10:21:57 [INFO] <nya_exif::core::app:170>:Finished

    The version of nya-exit is the latest and exiftool installed correctly as well.

    Here is a screenshot of my backUpData.csv:

    image

    Please help me to fix solve this issue :)

    opened by barryz 0
Releases(v0.1.3-hotfix)
Owner
Lyn Chen
Nya!
Lyn Chen
A cross platform reloading image viewer combined with a command executor

Watchout A cross platform reloading image viewer combined with a command executor. Watchout will do any of the following: Run a command when any file

Benedikt Terhechte 6 Oct 7, 2022
Screen-capturer: A cross-platform screenshots library for MacOS、Windows、Linux(X11).

Screen-capturer: A cross-platform screenshots library for MacOS、Windows、Linux(X11).

nashaofu 49 Dec 12, 2022
Converts images into textual line art.

img2utf Transform images to textual line art! Images require pre-processing to come out nice. It's expected that users will do the following: Apply ga

Lee 149 Dec 10, 2022
Convert your ascii diagram scribbles into happy little SVG

Svgbob Svgbob can create a nice graphical representation of your text diagrams. Svgbob provides a cli which takes text as an input and creates an svg

Jovansonlee Cesar 3.4k Dec 25, 2022
A simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art version constructed with emoji

EmojiPix This is a simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art vers

Michael Milton 22 Dec 6, 2022
🖼️Combines a Javascript and WASM file into a single executable polygot PNG+HTML file.

WASIMAGE Combines a Javascript and WASM file into a single executable polygot PNG+HTML file. Usage: cargo install wasimage wasimage --wasm-file my.was

Nervive 2 Mar 30, 2022
An intel PT trace converter from `perf.data` to Fuchsia trace format.

Introduction Recent Intel processors feature the "Intel Processor Trace" feature, which can be used to capture the full execution trace of a program.

Michał Chojnowski 14 Nov 9, 2022
tai (Terminal Ascii Image) tool to convert images to ascii written in Rust

TAI Terminal Ascii Image A tool to convert images to ascii art written in Rust ?? Notes This tool is still in development stage. Contributions All Con

Mustafa Salih 258 Dec 5, 2022
Slideo: This tool uses OpenCV to automatically synchronize slides with videos that show these slides.

This tool matches video frames against PDF pages by using computer vision. It also ships a web app in which you can click on a PDF page to play the video from the first frame showing the page. Its primary use-case is to quickly play a recorded lecture from a given slide.

Henning Dieterichs 78 Oct 7, 2022
The tool to make svg with triangles by length from two points.

The tool to make svg with triangles by length from two points.

null 2 Sep 27, 2021