Exiv2 is a C++ library and a command line utility to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata. Exiv2 also features a collection of sample and test command-line programs. Please be aware that while the program _**exiv2**_ enjoys full support from Team Exiv2, the other programs have been written for test, documentation or development purposes. You are expected to read the code to discover the specification of programs other than _**exiv2**_.
| _**addmoddel**_ | Demonstrates Exiv2 library APIs to add, modify or delete metadata | [addmoddel](#addmoddel) | [addmoddel.cpp](samples/addmoddel.cpp) |
| _**exifcomment**_ | Set Exif.Photo.UserComment in an image | [exifcomment](#exifcomment) | [exifcomment.cpp](samples/exifcomment.cpp) |
| _**exifdata**_ | Prints _**Exif**_ metadata in different formats in an image | [exifdata](#exifdata) | [exifdata.cpp](samples/exifdata.cpp) |
| _**exifprint**_ | Print _**Exif**_ metadata in images<br>Miscelleous other features | [exifprint](#exifprint)| [exifprint.cpp](samples/exifprint.cpp) |
| _**exifvalue**_ | Prints the value of a single _**Exif**_ tag in a file | [exifvalue](#exifvalue) | [exifvalue.cpp](samples/exifvalue.cpp) |
| _**exiv2**_ | Command line utility to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata.<br>This is the primary test tool used by Team Exiv2 and can exercise almost all code in the library. Due to the extensive capability of this utility, the APIs used are usually less obvious for casual code inspection. | [https://exiv2.org/manpage.html](https://exiv2.org/manpage.html)<br>[https://exiv2.org/sample.html](https://exiv2.org/sample.html) | |
| _**exiv2json**_ | Extracts data from image in JSON format.<br>This program also contains a parser to recursively parse Xmp metadata into vectors and objects. | [exiv2json](#exiv2json) | [exiv2json.cpp](samples/exiv2json.cpp) |
| _**geotag**_ | Reads GPX data and updates images with GPS Tags | [geotag](#geotag) | [geotag.cpp](samples/geotag.cpp) |
| _**iptceasy**_ | Demonstrates read, set or modify IPTC metadata | [iptceasy](#iptceasy) | [iptceasy.cpp](samples/iptceasy.cpp) |
| _**iptcprint**_ | Demonstrates Exiv2 library APIs to print Iptc data | [iptceasy](#iptceasy) | [iptcprint.cpp](samples/iptcprint.cpp) |
| _**metacopy**_ | Demonstrates copying metadata from one image to another | [metacopy](#metacopy) | [metacopy.cpp](samples/metacopy.cpp) |
| _**mrwthumb**_ | Sample program to extract a Minolta thumbnail from the makernote | [mrwthumb](#mrwthumb) | [mrwthumb.cpp](samples/mrwthumb.cpp) |
| _**xmpparse**_ | Read an XMP packet from a file, parse it and print all (known) properties. | [xmpparse](#xmpparse) | [xmpparse.cpp](samples/xmpparse.cpp) |
| _**xmpprint**_ | Read an XMP from a file, parse it and print all (known) properties.. | [xmpprint](#xmpprint) | [xmpprint.cpp](samples/xmpprint.cpp) |
As Exiv2 is open source, we publish all our materials. The following programs are actively used in our test harness. Some were written during feature development of features and their on-going use may be limited, or even obsolete. In general these programs are published as source and Team Exiv2 will not provide support to users.
This program demonstrates how to print _**Exif**_ metadata in an image. This program is also discussed in the platform ReadMe.txt file included in a build bundle. The option **--version** was added to enable the user to build a test application which dumps the build information. The option **--version-test** was added to test the macro EXIV2\_TEST\_VERSION() in **include/exiv2/version.hpp**.
There is one other unique feature of this program. It is the only test/sample program which can use the EXV\_UNICODE\_PATH build feature of Exiv2 on Windows.
_Code: [exifprint.cpp](samples/exifprint.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="exifvalue">
#### exifvalue
```
Usage: exifvalue file tag
```
Prints the value of a single _**Exif**_ tag in a file. _Code: [exifvalue.cpp](samples/exifvalue.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="exiv2json">
#### exiv2json
```
Usage: exiv2json [-option] file
Option: all | exif | iptc | xmp | filesystem
```
| Arguments | Description |
|:-- |:--- |
| all | All metadata |
| filesystem | Filesystem metadata |
| exif | Exif metadata |
| iptc | Iptc metadata |
| xmp | Xmp metadata |
| file | path to image |
This program dumps metadata from an image in JSON format. _Code: [exiv2json.cpp](samples/exiv2json.cpp)_
exiv2json has a recursive parser to encode XMP into Vectors and Objects. XMP data is XMP and can contain XMP `Bag` and `Seq` which are converted to JSON Objects and Arrays. Exiv2 presents data in the format: Family.Group.Tag. For XMP, results in "flat" output such such as:
exiv2json parses the Exiv2 'Family.Group.Tag' data and restores the structure of the original data in JSON. _Code: [exiv2json.cpp](samples/exiv2json.cpp)_
Geotag reads one or more GPX files and adds GPS Tages to images. _Code: [geotag.cpp](samples/geotag.cpp)_
If the path is a directory, geotag will read all the files in the directory. It constructs a time dictionary of position data, then updates every image with GPS Tags.
I use this program frequently. I have a little Canon camera which I take when I run. My Samsung Galaxy Watch uploads my runs to Strava and I download the GPX. If I'm in another time-zone and have forgotten to change the time setting in the camera, I use `-adjust` to alter the images. The GPX time is always correct, however the camera is normally off by seconds or minutes. This option enables you to correct for inaccuracy in the setting of the camera time.
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="iptceasy">
#### iptceasy
```
Usage: iptceasy file
Reads and writes raw metadata. Use -h option for help.
```
Demonstrates read, set or modify IPTC metadata. _Code: [iptceasy.cpp](samples/iptceasy.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="iptcprint">
#### iptcprint
```
Usage: iptcprint file
Reads and writes raw metadata. Use -h option for help.
```
Demonstrates Exiv2 library APIs to print Iptc data. _Code: [iptcprint.cpp](samples/iptcprint.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="metacopy">
#### metacopy
```
Usage: metacopy [-iecaph] readfile writefile
Reads and writes raw metadata. Use -h option for help.
```
Metacopy is used to copy a complete metadata block from one file to another. _Code: [metacopy.cpp](samples/metacopy.cpp)_
Please note that some metadata such as Exif.Photo.PixelXDimension is considered to be part of the image and will not be copied.
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="mrwthumb">
#### mrwthumb
```
Usage: mrwthumb file
```
Sample program to extract a Minolta thumbnail from the makernote. _Code: [mrwthumb.cpp](samples/mrwthumb.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="xmpparse">
#### xmpparse
```
Usage: xmpparse file
```
Read an XMP packet from a file, parse it and print all (known) properties. _Code: [xmpparse.cpp](samples/xmpparse.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="xmpprint">
#### xmpprint
```
Usage: xmpprint file
```
Read an XMP from a file, parse it and print all (known) properties. _Code: [xmpprint.cpp](samples/xmpprint.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="xmpsample">
#### xmpsample
```
Usage: xmpsample file
```
Demonstrates Exiv2 library high level XMP classes. _Code: [xmpsample.cpp](samples/xmpsample.cpp)_
[Sample](#TOC1) Programs [Test](#TOC2) Programs
## 3 Test Program Descriptions
<divid="conntest">
#### conntest
```
Usage: conntest url {-http1_0}
```
Test http/https/ftp/ssh/sftp connection
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="convert-test">
#### convert-test
```
Usage: convert-test file
```
Conversion test driver
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="easyaccess-test">
#### easyaccess-test
```
Usage: easyaccess-test file
```
Sample program using high-level metadata access functions
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="getopt-test">
#### getopt-test
```
Usage: getopt-test
```
This program is used to test the function **getopt()**. Prior to Exiv2 v0.27, the sample programs used the platform's C Runtime Library function **getopt()**. Visual Studio builds used code in src/getopt.cpp. Due to differences in the platform **getopt()**, the code in src/getopt.cpp was modified and adopted on every platforms. This test program was added for test and debug purpose. Please note that src/getopt.cpp is compiled and linked into the sample application and is not part of the Exiv2 library.
[Sample](#TOC1) Programs [Test](#TOC2) Programs
<divid="ini-test">
#### ini-test
```
Usage: ini-test
```
This program is used to test reading the file ini-test. This program was added in Exiv2 v0.26 when the ~/.exiv2 file was added to the Exiv2 architecture.
These options are provided to list every Exif tag known to Exiv2. The option `all` prints Group.Name for every tag. The option `ALL` print Group.Name followed by the TagInfo for that tag. For example:
```bash
$ taglist all | grep ISOSpeed$
Photo.ISOSpeed
PanasonicRaw.ISOSpeed
CanonCs.ISOSpeed
CanonSi.ISOSpeed
Casio2.ISOSpeed
MinoltaCs5D.ISOSpeed
MinoltaCs7D.ISOSpeed
Nikon1.ISOSpeed
Nikon2.ISOSpeed
Nikon3.ISOSpeed
Olympus.ISOSpeed
Olympus2.ISOSpeed
```
```bash
$ taglist ALL | grep ISOSpeed,
Photo.ISOSpeed, 34867, 0x8833, Photo, Exif.Photo.ISOSpeed, Long, This tag indicates the ISO speed value of a camera or input device that is defined in ISO 12232. When recording this tag, the PhotographicSensitivity and SensitivityType tags shall also be recorded.
PanasonicRaw.ISOSpeed, 23, 0x0017, PanasonicRaw, Exif.PanasonicRaw.ISOSpeed, Short, ISO speed setting
CanonCs.ISOSpeed, 16, 0x0010, CanonCs, Exif.CanonCs.ISOSpeed, SShort, ISO speed setting
CanonSi.ISOSpeed, 2, 0x0002, CanonSi, Exif.CanonSi.ISOSpeed, Short, ISO speed used
Casio2.ISOSpeed, 20, 0x0014, Casio2, Exif.Casio2.ISOSpeed, Short, ISO Speed
MinoltaCs5D.ISOSpeed, 38, 0x0026, MinoltaCs5D, Exif.MinoltaCs5D.ISOSpeed, Short, ISO speed setting
MinoltaCs7D.ISOSpeed, 28, 0x001c, MinoltaCs7D, Exif.MinoltaCs7D.ISOSpeed, Short, ISO speed setting
Nikon1.ISOSpeed, 2, 0x0002, Nikon1, Exif.Nikon1.ISOSpeed, Short, ISO speed setting
Nikon2.ISOSpeed, 6, 0x0006, Nikon2, Exif.Nikon2.ISOSpeed, Short, ISO speed setting
Nikon3.ISOSpeed, 2, 0x0002, Nikon3, Exif.Nikon3.ISOSpeed, Short, ISO speed setting
Olympus.ISOSpeed, 4097, 0x1001, Olympus, Exif.Olympus.ISOSpeed, SRational, ISO speed value
Olympus2.ISOSpeed, 4097, 0x1001, Olympus, Exif.Olympus.ISOSpeed, SRational, ISO speed value
Sony1MltCs7D.ISOSpeed, 28, 0x001c, MinoltaCs7D, Exif.MinoltaCs7D.ISOSpeed, Short, ISO speed setting