Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8298091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:38:49+00:00 2026-06-08T15:38:49+00:00

Using the Exiv2 library to write some exif tags to an image i’m running

  • 0

Using the Exiv2 library to write some exif tags to an image i’m running the below code, similar to the examples provided on the Exiv2 site.

However, some throw errors and some simply don’t write but throw no errors. I’ve noticed that tags with Exif.Image.* don’t work and some with Exif.Photo.* work and some don’t, but can’t find a pattern.

I’m checking what’s written to the file by using JHEAD.

Wondering if anyone has come across this behaviour in the past or knows whats going on? Thanks.

Exiv2::ExifData exifData;

try {

 // these work fine
 exifData["Exif.Photo.FNumber"] = Exiv2::Rational(7, 5); 
 exifData["Exif.Photo.ExposureTime"] = Exiv2::Rational(1, 1);
 exifData["Exif.Photo.WhiteBalance"] = uint16_t(1);
 exifData["Exif.Photo.ShutterSpeedValue"] = Exiv2::Rational(1, 1);
 exifData["Exif.Photo.DateTimeOriginal"] = "12:12:12";

 // throw errors
 exifData["Exif.Photo.ISOSpeed"] = int32_t(2); 

 // don't throw error, but don't write to jpg
 exifData["Exif.Photo.GainControl"] = uint16_t(0);
 exifData["Exif.Photo.Saturation"] = uint16_t(100);
 exifData["Exif.Photo.Sharpness"] = uint16_t(2);

Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open("filepath");
assert(image.get() != 0);

image->setExifData(exifData);
image->writeMetadata();

}
catch (Exiv2::AnyError& e) {
cout << "Caught Exiv2 exception '" << e << "'\n";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:38:50+00:00Added an answer on June 8, 2026 at 3:38 pm

    Running this code with both a JPEG and a TIFF image, I can’t reproduce the problems described; it doesn’t throw any exception and all tags are written to the image.

    It is however true that Exiv2 silently does not write certain tags. That happens if the target image is a TIFF-like image, it does not happen with JPEGs. The tags that are ignored are TIFF “image tags” that Exiv2 considers relevant for the integrity of the image itself, since in the structure of TIFF-like images, image tags and metadata co-exist. All of these image tags are from the “Image” group (Exif.Image.*), an example is Exif.Image.ImageWidth.

    If you can provide a reproducer – or a target image in addition to the above code – that triggers the described behavior, please report this as an issue in the Exiv2 bugtracker at dev.exiv2.org.

    Andreas

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using GTKmm and exiv2 to read EXIF metadata form photos. However Exiv2
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
I have program using gtkmm, gtkglextmm and exiv2. I want to include these libraries
I use the Exiv2 command line tool on Linux to edit image metadata like
Using the opencart image manager how would I set the upload to automatically remove:
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C#, I want to show the image in the Access column but failed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.