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



Go to last post Go to first unread
#1 Posted : Tuesday, November 14, 2006 10:56:22 PM(UTC)

Rank: Member

Groups: Member
Joined: 11/14/2006(UTC)
Posts: 1

am trying to figue out how to set the ExifDictionary.UserComment field. I tried
JpegReader jpegReader = (JpegReader) formatReader;
ExifDictionary exifData = jpegReader.Exif;
exifData[  ExifDictionary.UserComment  ] = "blah blah";
but this fails. any ideas? thanks! port119

Edited by user Tuesday, December 18, 2007 8:13:52 PM(UTC)  | Reason: Not specified

#2 Posted : Thursday, November 16, 2006 6:47:50 PM(UTC)

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello, This tag contains byte buffer which can include different types of information: ASCII, JIS, Unicode and undefibed. This information can be obtained from EXIF specification. Here is sample code which writes ASCII string in this tag:
string comment = "blah blah";
System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
// Byte buffer. This buffer contains string with 8 byte prefix, which includes information type.
byte[] array = new byte[comment.Length + 8];
array[7] = 2; // ASCII flag
encoder.GetBytes(comment).CopyTo(array, 8);
Aurigma.GraphicsMill.Codecs.JpegReader jpegReader = new Aurigma.GraphicsMill.Codecs.JpegReader(@"d:/temp/xmp/xmp1.jpg");
Aurigma.GraphicsMill.Codecs.JpegWriter writer = new Aurigma.GraphicsMill.Codecs.JpegWriter(@"d:/temp/UserComment.jpg");
// Write destination Jpeg.
Aurigma.GraphicsMill.Codecs.ExifDictionary exifData = jpegReader.Exif;
exifData[Aurigma.GraphicsMill.Codecs.ExifDictionary.UserComment] = array;
writer.Exif = exifData;
jpegReader .Close();

Edited by user Tuesday, December 18, 2007 8:16:33 PM(UTC)  | Reason: Not specified

Sincerely yours, Dmitry Sevostyanov UserPostedImage Follow Aurigma on Twitter!
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.