Take the 2-minute tour ×

Searched through net, could't find a way to read/write file metadata using C or C++, however, there are tools available for this, and also there are API's in C# and Java to do this. But I want to do it from scratch in C or C++.

For example, read/write image metadata.

Have found out that there are three formats in which metadata is written to files. EXIF, IPTC and XMP.


share|improve this question
It isn't clear what kind of help you want. –  Marcelo Cantos May 13 '10 at 7:38
add comment

2 Answers

up vote 3 down vote accepted

Why would you want to do it from scratch?

Anyway, you need documentation and you may also want to look at an existing library for helps, expecially if you have no experience in the field.

Have you tried Exiv ?


share|improve this answer
Don't want to use any library. Thanks for the information about the library anyway. –  mag May 17 '10 at 1:49
add comment

There are different solutions. One is to define a structure (but make sure the field alignements are correct), then read the data, and use the structure to access the fields. Trivial example:

struct header {
    uint32_t len;
    unsigned char type;
    char name[16];

struct header hdr;


... access your fields using the structure ...

The topic is a bit more complex than this ;) But since you did not specified much more I think this still can help a bit.

share|improve this answer
Thanks for the structure. But you realize yourself that it's not that simple! –  mag May 17 '10 at 1:50
add comment

Your Answer


