{"id":15563087,"url":"https://github.com/dsoprea/go-exif-knife","last_synced_at":"2025-10-24T18:39:57.679Z","repository":{"id":57515383,"uuid":"136472831","full_name":"dsoprea/go-exif-knife","owner":"dsoprea","description":"Perform surgical operations on EXIF data at the command-line with JPG, PNG, HEIC, and TIFF files.","archived":false,"fork":false,"pushed_at":"2021-05-12T21:21:54.000Z","size":9012,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-03T22:42:06.368Z","etag":null,"topics":["exif","heic","heif","image-processing","jpeg","png"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsoprea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-07T12:17:11.000Z","updated_at":"2023-08-31T02:41:59.000Z","dependencies_parsed_at":"2022-08-30T04:20:19.104Z","dependency_job_id":null,"html_url":"https://github.com/dsoprea/go-exif-knife","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsoprea%2Fgo-exif-knife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsoprea%2Fgo-exif-knife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsoprea%2Fgo-exif-knife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsoprea%2Fgo-exif-knife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsoprea","download_url":"https://codeload.github.com/dsoprea/go-exif-knife/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232622454,"owners_count":18551773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exif","heic","heif","image-processing","jpeg","png"],"created_at":"2024-10-02T16:17:44.119Z","updated_at":"2025-10-24T18:39:52.647Z","avatar_url":"https://github.com/dsoprea.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/dsoprea/go-exif-knife.svg?branch=master)](https://travis-ci.org/dsoprea/go-exif-knife)\n[![codecov](https://codecov.io/gh/dsoprea/go-exif-knife/branch/master/graph/badge.svg)](https://codecov.io/gh/dsoprea/go-exif-knife)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dsoprea/go-exif-knife)](https://goreportcard.com/report/github.com/dsoprea/go-exif-knife)\n[![GoDoc](https://godoc.org/github.com/dsoprea/go-exif-knife?status.svg)](https://godoc.org/github.com/dsoprea/go-exif-knife)\n\n\n## Overview\n\nThis is a command-line tool to perform a multitude of surgical operations on the EXIF data in any file that contains it.\n\nThis tool has been written on top of [go-exif](https://github.com/dsoprea/go-exif), a complete EXIF implementation.\n\n\n## Image Support\n\n**JPEG, PNG, HEIC, and TIFF (naturally, since EXIF takes the TIFF structure) are well supported.** A byte-by-byte search will be performed for all other types of file. Writes are only supported for JEPG and PNG.\n\n\n```\n$ ./go-exif-knife write --filepath image.png --set-tag=ifd0,Make,testing --output-filepath /tmp/updated.png\n\n$ ./go-exif-knife read --filepath /tmp/updated.png\n IFD: Ifd\u003cID=(0) PARENT-IFD=[] IFD=[IFD] INDEX=(0) COUNT=(1) OFF=(0x0008) CHILDREN=(0) PARENT=(0x0000) NEXT-IFD=(0x0000)\u003e\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x010f) TAG-TYPE=[ASCII] UNIT-COUNT=(8)\u003e NAME=[Make] VALUE=[testing]\n```\n\n\n## Install\n\n### Get\n\n- Get via [Github Releases](https://github.com/dsoprea/go-exif-knife/releases)\n- Get via go-get and build: \"go get github.com/dsoprea/go-exif-knife\"\n\n### Install\n\n1. Make the file executable (\"chmod 755 [filename]\")\n2. Put the binary in your path.\n\n\n## Usage\n\nThis tool is comprised of one tool with multiple subcommands. The root tool and the various subcommands provide complete command-line help.\n\n\n## Examples\n\n### Read\n\n#### Print All Tags\n\nOutput (shortened for succinctness):\n\n```\n$ ./go-exif-knife read --filepath image.jpg\n IFD: Ifd\u003cID=(0) PARENT-IFD=[] IFD=[IFD] INDEX=(0) COUNT=(11) OFF=(0x0008) CHILDREN=(2) PARENT=(0x0000) NEXT-IFD=(0x039e)\u003e\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x010f) TAG-TYPE=[ASCII] UNIT-COUNT=(8)\u003e NAME=[Make] VALUE=[samsung]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0110) TAG-TYPE=[ASCII] UNIT-COUNT=(9)\u003e NAME=[Model] VALUE=[SM-N920T]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0112) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[Orientation] VALUE=[[1]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0131) TAG-TYPE=[ASCII] UNIT-COUNT=(12)\u003e NAME=[Software] VALUE=[GIMP 2.8.20]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0132) TAG-TYPE=[ASCII] UNIT-COUNT=(20)\u003e NAME=[DateTime] VALUE=[2018:06:09 01:07:30]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0213) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[YCbCrPositioning] VALUE=[[1]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[Exif] TAG-ID=(0x8769) TAG-TYPE=[LONG] UNIT-COUNT=(1)\u003e\n   IFD: Ifd\u003cID=(1) PARENT-IFD=[IFD] IFD=[Exif] INDEX=(0) COUNT=(26) OFF=(0x00d4) CHILDREN=(1) PARENT=(0x0008) NEXT-IFD=(0x0000)\u003e\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x829a) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[ExposureTime] VALUE=[[{1 13}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x829d) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[FNumber] VALUE=[[{19 10}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x8822) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[ExposureProgram] VALUE=[[2]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x9209) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[Flash] VALUE=[[0]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x920a) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[FocalLength] VALUE=[[{430 100}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x9286) TAG-TYPE=[UNDEFINED] UNIT-COUNT=(21)\u003e NAME=[UserComment] VALUE=[UserComment\u003cSIZE=(13) ENCODING=[ASCII] V=[0 0 0 73 73 67 83 65]... LEN=(13)\u003e]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0xa000) TAG-TYPE=[UNDEFINED] UNIT-COUNT=(4)\u003e NAME=[FlashpixVersion] VALUE=[0100]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0xa001) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[ColorSpace] VALUE=[[1]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0xa002) TAG-TYPE=[LONG] UNIT-COUNT=(1)\u003e NAME=[PixelXDimension] VALUE=[[920]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0xa003) TAG-TYPE=[LONG] UNIT-COUNT=(1)\u003e NAME=[PixelYDimension] VALUE=[[570]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[Iop] TAG-ID=(0xa005) TAG-TYPE=[LONG] UNIT-COUNT=(1)\u003e\n     IFD: Ifd\u003cID=(4) PARENT-IFD=[Exif] IFD=[Iop] INDEX=(0) COUNT=(2) OFF=(0x02b2) CHILDREN=(0) PARENT=(0x00d4) NEXT-IFD=(0x0000)\u003e\n     - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0001) TAG-TYPE=[ASCII] UNIT-COUNT=(4)\u003e NAME=[InteroperabilityIndex] VALUE=[R98]\n     - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0002) TAG-TYPE=[UNDEFINED] UNIT-COUNT=(4)\u003e NAME=[InteroperabilityVersion] VALUE=[0100]\n - TAG: IfdTagEntry\u003cTAG-IFD=[GPSInfo] TAG-ID=(0x8825) TAG-TYPE=[LONG] UNIT-COUNT=(1)\u003e\n   IFD: Ifd\u003cID=(2) PARENT-IFD=[IFD] IFD=[GPSInfo] INDEX=(0) COUNT=(9) OFF=(0x02d0) CHILDREN=(0) PARENT=(0x0008) NEXT-IFD=(0x0000)\u003e\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0000) TAG-TYPE=[BYTE] UNIT-COUNT=(4)\u003e NAME=[GPSVersionID] VALUE=[[2 2 0 0]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0001) TAG-TYPE=[ASCII] UNIT-COUNT=(2)\u003e NAME=[GPSLatitudeRef] VALUE=[N]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0002) TAG-TYPE=[RATIONAL] UNIT-COUNT=(3)\u003e NAME=[GPSLatitude] VALUE=[[{26 1} {35 1} {12 1}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0006) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[GPSAltitude] VALUE=[[{0 1}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0007) TAG-TYPE=[RATIONAL] UNIT-COUNT=(3)\u003e NAME=[GPSTimeStamp] VALUE=[[{1 1} {22 1} {57 1}]]\n   - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x001d) TAG-TYPE=[ASCII] UNIT-COUNT=(11)\u003e NAME=[GPSDateStamp] VALUE=[2018:04:29]\n\u003eIFD: Ifd\u003cID=(3) PARENT-IFD=[] IFD=[IFD] INDEX=(1) COUNT=(4) OFF=(0x039e) CHILDREN=(0) PARENT=(0x0000) NEXT-IFD=(0x0000)\u003e\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0103) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[Compression] VALUE=[[6]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x011a) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[XResolution] VALUE=[[{72 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x011b) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[YResolution] VALUE=[[{72 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0128) TAG-TYPE=[SHORT] UNIT-COUNT=(1)\u003e NAME=[ResolutionUnit] VALUE=[[2]]\n```\n\n\n#### Print Specific Tags in All IFDs Using Name\n\n```\n$ ./go-exif-knife read --filepath image.jpg --tag Model\nModel: SM-N920T\n```\n\n\"--tag\" can be provided multiple times.\n\n\n#### Print Tag With Name and IFD\n\n```\n$ ./go-exif-knife read --filepath \"assets/image.jpg\" --tag Model --ifd ifd0\nModel: Canon EOS 5D Mark III\n```\n\n\"--tag\" can be provided multiple times.\n\n\n#### Print All Tags in IFD\n\n```\n$ ./go-exif-knife read --filepath image.jpg --ifd gps\n IFD: Ifd\u003cID=(2) PARENT-IFD=[IFD] IFD=[GPSInfo] INDEX=(0) COUNT=(9) OFF=(0x02d0) CHILDREN=(0) PARENT=(0x0008) NEXT-IFD=(0x0000)\u003e\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0000) TAG-TYPE=[BYTE] UNIT-COUNT=(4)\u003e NAME=[GPSVersionID] VALUE=[[2 2 0 0]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0001) TAG-TYPE=[ASCII] UNIT-COUNT=(2)\u003e NAME=[GPSLatitudeRef] VALUE=[N]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0002) TAG-TYPE=[RATIONAL] UNIT-COUNT=(3)\u003e NAME=[GPSLatitude] VALUE=[[{26 1} {35 1} {12 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0003) TAG-TYPE=[ASCII] UNIT-COUNT=(2)\u003e NAME=[GPSLongitudeRef] VALUE=[W]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0004) TAG-TYPE=[RATIONAL] UNIT-COUNT=(3)\u003e NAME=[GPSLongitude] VALUE=[[{80 1} {3 1} {13 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0005) TAG-TYPE=[BYTE] UNIT-COUNT=(1)\u003e NAME=[GPSAltitudeRef] VALUE=[[1]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0006) TAG-TYPE=[RATIONAL] UNIT-COUNT=(1)\u003e NAME=[GPSAltitude] VALUE=[[{0 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x0007) TAG-TYPE=[RATIONAL] UNIT-COUNT=(3)\u003e NAME=[GPSTimeStamp] VALUE=[[{1 1} {22 1} {57 1}]]\n - TAG: IfdTagEntry\u003cTAG-IFD=[] TAG-ID=(0x001d) TAG-TYPE=[ASCII] UNIT-COUNT=(11)\u003e NAME=[GPSDateStamp] VALUE=[2018:04:29]\n```\n\n\n#### Print as JSON\n\n```\n$ ./go-exif-knife read --filepath image.jpg --ifd gps --json\n{\n    \"gpsinfo\": {\n        \"GPSAltitude\": [\n            {\n                \"Numerator\": 0,\n                \"Denominator\": 1\n            }\n        ],\n        \"GPSAltitudeRef\": \"AQ==\",\n        \"GPSDateStamp\": \"2018:04:29\",\n        \"GPSLatitude\": [\n            {\n                \"Numerator\": 26,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 35,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 12,\n                \"Denominator\": 1\n            }\n        ],\n        \"GPSLatitudeRef\": \"N\",\n        \"GPSLongitude\": [\n            {\n                \"Numerator\": 80,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 3,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 13,\n                \"Denominator\": 1\n            }\n        ],\n        \"GPSLongitudeRef\": \"W\",\n        \"GPSTimeStamp\": [\n            {\n                \"Numerator\": 1,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 22,\n                \"Denominator\": 1\n            },\n            {\n                \"Numerator\": 57,\n                \"Denominator\": 1\n            }\n        ],\n        \"GPSVersionID\": \"AgIAAA==\"\n    }\n}\n```\n\n\n#### Just Print Value(s)\n\n```\n$ ./go-exif-knife read --filepath image.jpg --tag Model --just-values\nSM-N920T\n```\n\n\"--tag\" can be provided multiple times.\n\n\n### GPS\n\n```\n$ ./go-exif-knife gps --filepath image.jpg\nGpsInfo\u003cLAT=(26.58667) LON=(-80.05361) ALT=(0) TIME=[2018-04-29 01:22:57 +0000 UTC]\u003e\n```\n\n```\n$ ./go-exif-knife gps --filepath image.jpg --json\n{\n    \"Altitude\": 0,\n    \"LatitudeDecimal\": 26.586666666666666,\n    \"LongitudeDecimal\": -80.05361111111111,\n    \"Timestamp\": \"2018-04-29T01:22:57Z\",\n    \"TimestampUnix\": 1524964977\n}\n```\n\n\nInclude a geohash calculated with the Google S2 (Hilbert Curve) algorithm:\n\n```\n$ ./go-exif-knife gps --filepath image.jpg --json --google-s2\n{\n    \"Altitude\": 0,\n    \"LatitudeDecimal\": 26.586666666666666,\n    \"LongitudeDecimal\": -80.05361111111111,\n    \"S2LocationId\": 6542766593732284747,\n    \"Timestamp\": \"2018-04-29T01:22:57Z\",\n    \"TimestampUnix\": 1524964977\n}\n```\n\n\n### Thumbnail\n\n```\n$ ./go-exif-knife thumbnail --filepath image.jpg --output-filepath /tmp/thumbnail.jpg\n```\n\n\n### Write\n\n```\n$ ./go-exif-knife read --filepath image.jpg --tag Make\nMake: samsung\n\n$ ./go-exif-knife write --filepath image.jpg --set-tag=ifd0,Make,testing --output-filepath /tmp/updated.jpg\n\n$ ./go-exif-knife read --filepath /tmp/updated.jpg --tag Make\nMake: testing\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsoprea%2Fgo-exif-knife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsoprea%2Fgo-exif-knife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsoprea%2Fgo-exif-knife/lists"}