
Friday April 17 2009 15:17
I was slightly surprised that google didn't turn up a solution to this one right off the bat, but it didn't, so here's my solution. I needed to extract metadata from some images, specifically the stuff which Windows Vista lets you edit from within the explorer - author, title, comments, that sort of thing. A quick check with PS suggests that these fields map variously back to the IPTC (IIM, legacy) and IPTC Core Exif fields; so long as you know which is which you can set the data in either place.
I recall from earlier work that IIS6 doesn'tnecessarily behave the same as IIS7 regarding the way the file system (NTFS) handles and presents extended properties; these days all my stuff is on the newer system so I don't care about IIS6.
There's not much to this, but you need to figure out which fields are which... I did this for the fields I care about in the code below. The file's data is utf-16 coded, which is slightly fiddily to deal with too.
More...