Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write metadata .net 1.1

Status
Not open for further replies.

Trebor100

Programmer
Mar 14, 2006
90
GB
Hi - I really hope someone can help me here as am well stuck. I'm forced to use .net 1.1 and need to be able to write the title and comment onto a .jpg via a web interface (prop id's 40091 and 40092 respectivly).

Can anyone out there help? from hours of googling (is that a word?) I havent been able to find a solution that works in the 1.1 framework :(

Cheers all,

Rob
 
I think you'll need to look into IPTC or EXIF. There are many libraries available on the web (some opensource) that you can use to accomplish your goal. I'm certainly not an expert in this area, but I have read a few articles and if I'm not mistaken IPTC is probably where you should start.

Hope this helps.

 
found a nice easy way to do this in the end - code extracts as follows:

Bitmap MyPhoto = new Bitmap(Server.MapPath(".") + "/tmp/" + fn);
PropertyItem[] props = MyPhoto.PropertyItems;

props[0].Id=40093;
props[0].Type=2;
props[0].Len=strAuthor.Length;
props[0].Value=bAuth;

MyPhoto.SetPropertyItem(props[0]);
MyPhoto.Save(Server.MapPath(".") + "\\tmp\\" + "MD_" + fn,System.Drawing.Imaging.ImageFormat.Jpeg);

MyPhoto.Dispose();
MyPhoto = null;
System.IO.File.Delete(fpn); //where fpn is the orig file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top