tags:

views:

4

answers:

0

I was able to successfully parse out EXIF and GPS tags from regular JPEG following the specs, no problem. But... now I need to write some of them back - modified. I know I can use libraries, but I'd rather write something myself. I just need to know what is an established practice of writing those tags, 'cause there are no direct instructions in specs, just tables denoting codes for tags, types and count of components. I'm not even sure if count of components for every particular tag is constant. Is it? If it is, then writing tags can be comparably easy. But even if count indicator is constant, some of the tags (like 'User comments' for example) have 'Any' instead of a specific number in count column. How one is supposed to treat these? Most of the time value won't fit within 4 byte limit and will need to be written at some offset (by the way, what is the rule of choosing the proper offset?). Do I need to enlarge corresponding IFD size and rewrite length and offset values of the directory? The whole thing is a bit confusing... Would appreciate any link or spec clearing the case.