Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, March 10, 2009 2:43:39 AM(UTC)

RaYWoLF  
RaYWoLF

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:

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, March 11, 2009 6:36:27 AM(UTC)

Adam Boulad  
Guest

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)

RaYWoLF  
RaYWoLF

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)

Adam Boulad  
Guest

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)

RaYWoLF  
RaYWoLF

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)

Adam Boulad  
Guest

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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.103 seconds.