# Exiv2: reading and rewriting Exif, IPTC, XMP and ICC without touching the pixels

> Exiv2 is a C++ library and command line utility for reading, writing, deleting and modifying image metadata, built around CMake, a ctest suite and continuous fuzzing. It suits applications that need to preserve or rewrite camera data, and its GPLv2 licence is the one thing to think about before you link it into a closed source product.

**Exiv2/exiv2** — Image metadata library and tools

- Repository: https://github.com/Exiv2/exiv2
- Website: http://www.exiv2.org/
- Stars: 1,168 · Forks: 339
- Language: C++
- License: NOASSERTION
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/exiv2-exiv2

## A library first, with a command line tool attached

Exiv2 is a C++ library and a command line utility to read, write, delete and modify Exif, IPTC, XMP and ICC image metadata. The ordering in that sentence matters, because the README treats the library as the product and the tool as one consumer of it. The evidence is the `samples/` directory, which holds a couple of dozen small programs that show the API from different angles: `exifprint.cpp` and `iptcprint.cpp` for reading and printing, `exifdata.cpp` and `exifvalue.cpp` for working with the parsed structures, `easyaccess-test.cpp` for the convenience accessors, `geotag.cpp` for location data, `metacopy.cpp` for copying metadata between files, `mmap-test.cpp` for memory mapped access, `addmoddel.cpp` for modification, and `ini-test.cpp` for the configuration file format. Two further manuals sit at the repository root, `README-SAMPLES.md` as the sample code manual and `README-CONAN.md` for the Conan package manager route. The four metadata families are the scope: Exif for camera settings, IPTC for publishing metadata, XMP for the extensible Adobe format, and ICC for colour profiles, and the table of contents also records support for BMFF files such as CR3, HEIF, HEIC, AVIF and JPEG XL.

## Building on a UNIX system takes five commands

The build needs CMake and any C++ compiler implementing the C++ 20 standard with its tool chain, and then the sequence below does the rest, from configuring through the test suite to installation.

```bash
$ cd ~/gnu/github/exiv2                          # Location of the project code
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release # Configure the project with CMake
$ cmake --build build                            # Compile the project
$ ctest --test-dir build --verbose               # Run tests
$ sudo cmake --install build                     # Run the install target (install library, public headers, application and CMake files)
```

The install puts the library in `/usr/local/lib`, the executables including the exiv2 command line program in `/usr/local/bin/`, and the headers in `/usr/local/include/exiv2`, and the target directory can be changed with the CMake option `-DCMAKE_INSTALL_PREFIX`. Two generated headers come out of the configure step, `exv_conf.h` and `exiv2lib_export.h`, which carry compiler directives about the build options you chose and about the availability of libraries on your machine, so they are where you look to find out what the build actually enabled. At run time the freshly installed binary needs its library path set, which is three lines that differ by platform.

```bash
$ export PATH="/usr/local/bin:$PATH"
$ export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"      # Linux, Cygwin, MinGW/msys2
$ export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"  # macOS
```

Uninstalling is a build target, `cmake --build build --target uninstall`, and the README notes that this mechanism is not perfect and cannot remove the sub directories created in the installation path, a small and honest admission about the difference between uninstalling a distribution package and uninstalling a source build.

## Meson, Conan and Visual Studio are all supported routes

The build system story is broader than CMake alone. The repository carries `CMakePresets.json` and a documented section on configuring the project with CMake presets, so a team can keep several toolchain configurations in version control. It also carries `meson.build` and `meson_options.txt` with a separate `README-meson` document, which is a genuine alternative for people who prefer Meson. For Windows, the README recommends using Conan to download the external dependencies on Windows, and the repository has `conanfile.py` to match, while on other platforms such as macOS and Linux it points at the platform package manager as the traditional route. The build options and dependencies have their own sections, and there is a section on building with Clang and other build chains and another on building with ccache, both of which are the sort of detail that indicates the project is built on many different machines. The static and shared library question also has its own section, and since the library is loaded by name at run time, choosing one is a packaging decision rather than a preference.

## The test suite is split into units, bugfix cases and fuzzing

The table of contents shows a testing structure that is more thorough than most, and the continuous integration badges at the top of the README describe the same thing from the other side. There are separate workflows for the release, for nightly jobs against Linux distributions, for basic jobs on the main platforms, and for extra jobs on the main branch, which is a standard pattern for a project that is packaged by many distributions and therefore has to keep building on many combinations. Inside the test suite there are Unit Tests, Bugfix Tests and Fuzzing, and the fuzzing section points at OSS-Fuzz with a status badge for the project, which is a meaningful signal for a parser of untrusted binary input: Exiv2 spends a large part of its life reading metadata out of files that came from the internet, and continuous fuzzing is the mechanism that keeps a parser like that honest. The test suite also documents a set of Exiv2 environment variables that let you influence test behaviour, and the tests can be run on a UNIX-like system with ctest or from a Visual Studio build. Coverage is tracked with Codecov, and the project has a `SECURITY.md` file for responsible disclosure.

## Portability details that decide whether it fits your build

Several sections of the README exist for people whose build environment is unusual, and each one marks a real portability question. There is a thread safety section, which matters because a library that many image pipelines call from several threads needs a defined answer, and a library initialisation and cleanup section, which is the other half of that contract, since a library with global state has to be told when the process is done with it. There is a section on cross platform build and test on Linux for MinGW, which is the route for producing Windows binaries from a Unix environment, and platform notes for Linux, macOS, MinGW and msys2, Cygwin, Visual Studio and generic Unix. Localisation has its own section, and the tree shows a `po/` directory for message catalogues, a `man/` directory for manual pages and a `doc/` directory for the rest of the documentation, including a build step for the Exiv2 tag webpages that document every supported tag. Packaging is handled by the `ci/` directory and by distribution packaging status tracked through Repology, and the project runs a Matrix chat room for support.

## The licence is the decision point

The README's resource table lists the license as GPLv2 and points at the `COPYING` file for the terms, while the repository also carries a `LICENSE.txt` and GitHub's own classification of the licence is a custom one that it cannot categorise. The practical advice is to read `COPYING` and `LICENSE.txt` yourself rather than rely on the badge, and to treat the result as a distribution obligation rather than a technical detail: Exiv2 is used far more widely as a library inside other applications than as a standalone tool, and a copyleft licence that attaches to the combined work is exactly the situation where a product team needs to read the terms before shipping. The copyleft terms are what matter in practice, and this review gives no legal advice. Alongside the licence there is ordinary project hygiene worth noting: `CONTRIBUTING.md`, `CODING_GUIDELINES.md`, `GIT_GUIDELINES.md`, a `.mergify.yml` for merge automation, a `WORK-IN-PROGRESS` file, a `releasenotes/` directory, and a separate pre-release site at pre-release.exiv2.org for builds that are not yet ready to be tagged.

## Conclusion

Adopt Exiv2 if your application has to read, rewrite or strip image metadata while leaving image data untouched, and if you want a mature, fuzz tested implementation instead of a format by format parser of your own. Do not adopt it into a closed source product without checking the licence, because the README points to a GPLv2 COPYING file while GitHub classifies the licence as a custom one, and copyleft obligations attach to how you distribute the combined work. Before you build, confirm your toolchain supports C++ 20, since the README requires a compiler implementing that standard, and decide between the CMake and Meson build systems, where the Meson path is documented in a separate README-meson file. Releases reach v0.28.9 from 2026-08-30, pre-releases are published separately, and the last push was on 2026-10-19.

## FAQ

### What metadata formats does Exiv2 support?

Exif, IPTC, XMP and ICC. The README also records support for BMFF based files such as CR3, HEIF, HEIC, AVIF and JPEG XL, alongside the classic JPEG and TIFF style containers.

### How do I build and install Exiv2 from source?

You need CMake and a compiler implementing the C++ 20 standard. Configure with `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release`, build with `cmake --build build`, run the tests with `ctest --test-dir build --verbose`, and install with `sudo cmake --install build`, which puts the library in /usr/local/lib, the tools in /usr/local/bin and the headers in /usr/local/include/exiv2.

### Is Exiv2 fuzz tested?

Yes. The README's test suite section covers Unit Tests, Bugfix Tests and Fuzzing, and the fuzzing section points at OSS-Fuzz with a status badge for the project. The continuous integration workflows cover the release, nightly Linux distribution jobs and basic and extra jobs on the main platforms.

### Which licence applies to Exiv2?

The README's resource table lists the license as GPLv2 and points at the COPYING file, and the repository also contains a LICENSE.txt. GitHub classifies the licence as a custom one, so read the files in the repository before you ship a product that links the library.

### Does Exiv2 support Meson and Conan?

Yes. The repository contains meson.build and meson_options.txt with a separate README-meson document, CMakePresets.json for CMake presets, and a conanfile.py with a README-CONAN.md manual, and the README recommends Conan for downloading external dependencies on Windows.

## Sources

- [Exiv2/exiv2 on GitHub](https://github.com/Exiv2/exiv2)
- [Issues](https://github.com/Exiv2/exiv2/issues)
- [Project website](http://www.exiv2.org/)
- [README](https://github.com/Exiv2/exiv2/blob/main/README.md)
- [Releases](https://github.com/Exiv2/exiv2/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/exiv2-exiv2
