What Is IPTC Metadata and How Do You Read or Edit It in Images?

Updated

IPTC metadata is descriptive, human-readable information embedded in an image file — captions, keywords, credits, copyright notices, locations, and similar editorial fields. It travels with the file, so it survives copying and uploading, unlike a separate sidecar document. You read or edit it with a metadata-aware tool; Exiv2 is one cross-platform C++ library and command-line utility that provides read and write access to IPTC, alongside Exif, XMP, and the ICC Profile, in various image formats. Use IPTC when the information describes the content and rights of the picture rather than the camera settings that produced it.

What IPTC metadata actually stores

The name comes from the International Press Telecommunications Council, which defined the standard for exchanging news photos between agencies and publishers. The fields are editorial by design:

  • Caption / description — what the image shows, written for a human reader.
  • Keywords — terms used for search and retrieval in a media asset system.
  • Credit line and source — who supplied the image and where it came from.
  • Copyright notice and rights usage terms — who owns it and how it may be used.
  • Byline / creator — the photographer or author.
  • Location fields — city, country, and related place data for editorial context.

If you have ever received a press photo with a ready-made caption and a mandatory credit line already attached, that is IPTC metadata doing its job.

IPTC vs. Exif vs. XMP

These three often live in the same file, and a tool like Exiv2 can read and write all of them. They are not competing versions of one thing; they answer different questions.

IPTC Exif XMP
Primary purpose Editorial description and rights Capture conditions and camera settings General-purpose, extensible metadata
Typical fields Caption, keywords, credit, copyright Aperture, shutter speed, ISO, lens, orientation Anything, including IPTC and Exif values mirrored into XML
Written by Editors, asset management systems The camera at capture time Editing software, asset systems, cameras
Format Legacy binary IIM blocks; newer work often uses XMP Binary TIFF-style tags XML packets
Best for Publishing, search, rights tracking Diagnostics, sorting by shooting conditions Modern workflows needing structure and extensibility

The practical consequence: modern editing tools increasingly store descriptive data in XMP rather than the older binary IPTC blocks. If you write only legacy IPTC and your downstream system reads only XMP, the caption may appear to vanish. When in doubt, write both, or confirm which one your target application reads.

Reading IPTC fields from an image

The general workflow with a command-line metadata tool is: point it at a file, ask it to print the IPTC group, and read the field names and values from the output.

  1. Confirm the tool is installed and can see the file. Run the tool's version or help command first; if it errors, the problem is installation or path, not metadata.
  2. Print the IPTC block. With Exiv2 the command is exiv2 -p iptc image.jpg (or the equivalent print option for the IPTC group). The expected result is a list of field names paired with their values.
  3. If the output is empty, the file either has no IPTC data or stores its descriptive data in XMP instead. Print the XMP group to check before concluding the metadata is missing.
  4. Read the values you need — caption, keywords, credit, copyright — and note the exact field names, because you will reuse them when writing.

For a batch, loop the command over a directory and redirect the output to a file so you can review many images at once.

Editing or writing IPTC fields

Writing follows the same structure in reverse: specify the field, give it a value, and save.

  1. Work on a copy first. Metadata writes modify the file; keep an untouched original until you have verified the result.
  2. Set one field at a time using the tool's modify command, naming the IPTC field and its new value. For example, setting the caption field to a specific string.
  3. Save the change to the file (or to a new output file, if the tool supports it).
  4. Verify by reading the field back with the same print command you used earlier. A write that reports success but does not appear on re-read usually means you wrote to a different metadata group than the one you are reading.
  5. Repeat for keywords, credit, and copyright as needed.

Setting several fields in one invocation is usually supported and is faster for bulk work, but verify each field individually the first time so you learn the exact naming your tool expects.

Common pitfalls

  • Format support varies. Not every image container can hold IPTC data, and support differs between JPEG, TIFF, PNG, and newer formats. Check that your file type is supported before assuming a write failed.
  • Character encoding. Legacy IPTC blocks have historically had weak encoding rules, so accented characters and non-Latin scripts can be mangled or dropped. If your captions are not plain ASCII, test one file and inspect the result rather than trusting a bulk run.
  • Fields dropped on save. Some editors rewrite a file and silently discard metadata groups they do not understand. Always re-read after saving with a different tool.
  • IPTC vs. XMP duplication. If both exist and disagree, your downstream application picks one. Decide which is authoritative for your workflow and keep them consistent.
  • Empty output misread as corruption. No IPTC fields printed usually means the data lives in XMP, not that the file is damaged.

Exiv2 is free software and is used in projects including KDE and GNOME desktops and applications such as GIMP, darktable, shotwell, GwenView, and Luminance HDR — so if you edit metadata inside one of those tools, you are often working with the same underlying capability. For scripted or batch work, the command-line utility gives you direct, repeatable control over exactly which IPTC fields are read and written.