Click here to Skip to main content
15,888,106 members
Please Sign up or sign in to vote.
4.33/5 (2 votes)
See more:
I'm working in a small project, that his major role is to edit the Metadata of an "jpg" image file, I'm using C# as a primary language. I did some research and I found about XMP from Adobe, I downloaded XMP toolkit dll file supporting C#

this is a small example for the code I'm trying to do:

C#
string filepath = @"C:\image.jpg";
void EditImage()
{
    try
    {
        using (Xmp xmp = Xmp.FromFile(filePath, XmpFileMode.ReadWrite))
        {

            string xmpDump = xmp.Dump();
            editdata(xmp);
            xmpDump = xmp.Dump();
            xmp.Save();


        }
    }
    catch (Exception e)
    {
        MessageBox.Show(e.Message);
    }
}
string Title = textbox1.Text;
string keywords = textbox2.Text;
void editdata(Xmp xmp)
{

    DublinCore dc = new DublinCore(xmp);
    dc.Subject.Clear();
    string[] keyword = keywords.Split('-');

    foreach (string item in keyword)
    {
        dc.Subject.Add(item);
    }

    dc.Title.Clear();
    dc.Title.DefaultValue = Title;
    dc.Description.Clear();
    dc.Description.DefaultValue = "Some description";
}


the Program goal is to edit the image Metadata to support Arabic language
what I'm trying yo do in this code is working perfectly, except when I want to add the description, this is an example for the tag -keyword- of the picture when I use the program:
"واحد; ????; ", this tag will be showing in the properites - details of the picture using windows 7.

Thank you for any help.

Best,
Posted
Comments
cbrewer57 27-May-15 13:16pm    
Where did you download the XMP DLL for windows at?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900