This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, March 10, 2009 2:43:39 AM(UTC)
Groups: Registered
Posts: 22
Hello, I'm using the Raster Imaging Pro v15 version (.NET version). I would like to know if it is possible to set custom information on a image saving with Leadtools.
This is an example of what I mean.
With info:
Without info:
#2
Posted
:
Wednesday, March 11, 2009 6:36:27 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
If you mean that you want to set the tags for a file (like the Copyright, Model and Make), you can use the WriteComment Method. For more information and to obtain a sample code, please check the help topics below in the .NET help file:
- WriteComment Method
- RasterCommentMetadataType Enumeration
#3
Posted
:
Thursday, March 12, 2009 7:31:47 AM(UTC)
Groups: Registered
Posts: 22
I don't know if they are called tags. I mean the properties inside the rectangle (on the first attached image).
I have tried to add a comment to an image, but nothing appears on the image properties. Am I doing something wrong?
Example code:
--------------------------------
RasterImage myimage= codecs.Load("C:\\test.jpg");
myimage.Comments.Add(new RasterCommentMetadata(RasterCommentMetadataType.Model, Encoding.Default.GetBytes("My model")));
codecs.Save(myimage, "C:\\test_2.jpg", RasterImageFormat.Jpeg, 24, 1, 1, 1, CodecsSavePageMode.Overwrite);
------------
#4
Posted
:
Sunday, March 15, 2009 3:26:43 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Try to write the comment using the code below:
RasterCommentMetadata comment = new RasterCommentMetadata();
comment.Type = RasterCommentMetadataType.Model;
string artistNameWrite = "My model";
comment.FromAscii(artistNameWrite);
_codecs.WriteComment(@"e:\test_2.jpg", 1, comment);
#5
Posted
:
Monday, March 16, 2009 1:21:05 AM(UTC)
Groups: Registered
Posts: 22
Using this code I get an "The required JPEG marker is missing" exception.
RasterCodecs.Startup();
RasterCodecs codecs = new RasterCodecs();
RasterImage myimage = codecs.Load("C:\\image.jpg");
RasterCommentMetadata comment = new RasterCommentMetadata();
comment.Type = RasterCommentMetadataType.Model;
string artistNameWrite = "My model";
comment.FromAscii(artistNameWrite);
codecs.Save(myimage, "C:\\image_2.jpg", RasterImageFormat.Jpeg, 24, 1, 1, 1, CodecsSavePageMode.Overwrite);
codecs.WriteComment("C:\\image_2.jpg", 1, comment);
RasterCodecs.Shutdown();
#6
Posted
:
Monday, March 16, 2009 7:18:51 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
It seems that the file you are trying to write the EXIF comment to a file that does not support that comment. You need to use EXIF files (Exif Jpeg and Exif TIFF) to be able to use that comment. For more information, please check the help topic 'RasterCommentMetadataType Enumeration' in the .NET help file
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.