Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Wednesday, March 18, 2009 11:07:20 PM(UTC)

Rank: Newbie

Groups: Member
Joined: 11/13/2008(UTC)
Posts: 4

I have a question about adding the DateCreated IPTC field, since my tests are successful writing to all the other fields in the IptcDictionary except DateCreated.

In the following code, all fields are written to the image file except for DateCreated. Must a particular format (yyyy-mm-dd, for example) be used? I’m using Adobe Photoshop to view the IPTC metadata after writing to the image file.

Thank you!

IptcDictionary iptc = new IptcDictionary();
iptc[IptcDictionary.ObjectName] = "My photo";
iptc[IptcDictionary.Credit] = "This is my photo's credit";
iptc[IptcDictionary.DateCreated] = "1/1/1980"; // doesn't work
iptc[IptcDictionary.City] = "Chicago";
iptc[IptcDictionary.State] = "IL";
iptc[IptcDictionary.CopyrightNotice] = "Copyright 2009";
iptc[IptcDictionary.Country] = "USA";
((JpegEncoderOptions)options).Iptc = iptc;
bitmap.Save(pathTo, options);

Edited by user Tuesday, March 24, 2009 7:59:07 PM(UTC)  | Reason: Not specified

#2 Posted : Thursday, March 19, 2009 2:06:40 PM(UTC)

Rank: Advanced Member

Groups: Administration
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)

According to IPTC specification DateCreated field has the following format:


To get more information you can read IPTC specification

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

#3 Posted : Tuesday, March 24, 2009 7:54:32 PM(UTC)

Rank: Newbie

Groups: Member
Joined: 11/13/2008(UTC)
Posts: 4

Thanks Tamila for the reply. Unfortunately this doesn't seem to resolve the issue.

Neither of the following lines actually add the IPTC metadata to the image:

iptc[IptcDictionary.DateCreated] = "01:01:80"; 
iptc[IptcDictionary.DateCreated] = "01:01:01";

Other fields like author and caption are written to the image.

I would appreciate your attention on this issue.

Thanks again.

#4 Posted : Wednesday, March 25, 2009 5:50:02 PM(UTC)

Rank: Newbie

Groups: Member
Joined: 11/13/2008(UTC)
Posts: 4

After further research I have determined the correct format, which is not the one provided by Tamila. In fact, the specification states clearly that the format "00:00:00" refers to the time, not the date!

To save 1/1/1980, the following code should be used:

iptc[IptcDictionary.DateCreated] = "19800101";

I hope this information will be helpful to someone in the future, you might want to consider including this in future documentation.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.