TIF image cannot remove Title, Subject, Authors, and copyright fields


#1

Hi Dear Sir/Madam,

The attached TIF image file had it’s Title, Subject, Authors, and copyright fields modified. After I use the official codes to remove the metadata, I noticed all four of these fields still contain data.

Here’s the test tif file.

Here’s the code we used https://docs.groupdocs.com/display/metadatanet/Add+or+Update+TIFF+tags+in+EXIF
We are using GroupDocs.Metadata v18.6

Btw, we have checked the “Camera serial number” field contained data , which was removed during the conversion process. Is it the expected behavoir, or this is a bug of GroupDocs.Metadata library?

Please have a check and let me know if you have any problem.


#2

@Glority_Developer,

Thanks for using GroupDocs.Metadata and sharing your concerns with us.

We have checked your provided tif image and it doesn’t contain any EXIF Tags or EXIF Info, however, it contains the following XMP metadata:

[MicrosoftPhoto:CameraSerialNumber] = test
[dc:title] = title
[dc:creator] = paul d
[dc:rights] = copyright
[dc:description] = title

Would you please confirm whether are you working with EXIF Info or XMP metadata. Also, please provide us the source code you are using to get, add/update or remove metadata separately. We shall be looking forward to your response.


#3

Here is source code our used:
FormatBase format = new TiffFormat(filePath);
((TiffFormat)format).RemoveXmpData();
ExifInfo exif = ((TiffFormat)format).GetExifInfo() ?? new ExifInfo();
List tags = new List();
tags.Add(new TiffAsciiTag(TiffTagIdEnum.Artist, string.Empty));
tags.Add(new TiffAsciiTag(TiffTagIdEnum.Copyright, string.Empty));
exif.Tags = tags.ToArray();
((TiffFormat)format).UpdateExifInfo(exif);
format.Save(outPath);
We can’t find any function to update tiff XMP metadata title,subject. Looking forward to your response.


#4

@Glority_Developer,

Thanks for sharing the source code with us.

We are able to reproduce your reported issue at our end. We have logged it in our Issue Tracking System as METADATANET-2418 for further investigation. We shall keep you informed in case of any updates in this regard.

Following is the sample code to update the XMP metadata in Tiff:

using (TiffFormat tiff = new TiffFormat("Flowerboy_orginal (1).tif"))
{
        // get xmp wrapper
        XmpPacketWrapper xmpPacket = tiff.GetXmpData();

        // create xmp wrapper if not exists
        if (xmpPacket == null)
        {
                    xmpPacket = new XmpPacketWrapper();
        }

         // check if DublinCore schema exists
         if (!xmpPacket.ContainsPackage(Namespaces.DublinCore))
         {
                   // if not - add DublinCore schema
                   xmpPacket.AddPackage(new DublinCorePackage());
         }

         // get DublinCore package
         DublinCorePackage dublinCorePackage = (DublinCorePackage)xmpPacket.GetPackage(Namespaces.DublinCore);                    
                   
         // set subject
         dublinCorePackage.SetSubject("New subject");                    
         // set title
         dublinCorePackage.SetTitle("New title");
         // update XMP package
         tiff.SetXmpData(xmpPacket);

         // commit changes
         tiff.Save("Flowerboy_orginal (1)_output.tif");                    
                    
 }

Hope it helps.


#5

We use this code try to update title and subject, title can be updated but SetSubject() will update tags not subject.
Source code our used:
if (xmpPacket == null)
{
xmpPacket = new XmpPacketWrapper();
}
if (!xmpPacket.ContainsPackage(Namespaces.DublinCore))
{
xmpPacket.AddPackage(new DublinCorePackage());
}
DublinCorePackage dublinCorePackage = (DublinCorePackage)xmpPacket.GetPackage(Namespaces.DublinCore);
for (int i = 0; i < options.DocumentData.Count; ++i)
{
DOCUMENTENUM data = (DOCUMENTENUM)options.DocumentData[i];
switch(data)
{
case DOCUMENTENUM.Title:
{
dublinCorePackage.SetTitle(string.Empty);
break;
}
case DOCUMENTENUM.Subject:
{
dublinCorePackage.SetSubject(“test”);
break;
}
default:
break;
}
}
if(format is TiffFormat)
{
((TiffFormat)format).SetXmpData(xmpPacket);
}
source_metadata.png (13.3 KB)
target_metadata.png (19.4 KB)


#6

@Glority_Developer,

Thanks for providing details.

We are able to reproduce your reported issue at our end. We have logged it in our Issue Tracking System as METADATANET-2420 for further investigation. We shall keep you informed in case of any updates in this regard.


#7

@Glority_Developer,

We further investigated your issue and noticed that you are checking metadata values using the default “file properties” dialog provided by Windows OS. Windows OS allows users to obtain some metadata values as follows:

  1. Right-click some image containing metadata
  2. Select the “Properties” menu item
  3. Switch on the “Details” tab

On the selected tab you can see some common information about the image. But the displayed values are not bound to particular metadata standards. Any field can display EXIF, XMP or IPTC properties depending on actual metadata values associated with the image. And obviously, it’s not guaranteed that a field displaying some metadata value will have the same name as the appropriate property in a particular standard. That’s why the “Details” tab cannot be used to check any values added by GroupDocs.Metadata.

In case you would have any questions, please feel free to let us know.


#8

@ali.ahmed

Do you have any progress on this issue? Btw, “Camera serial number” field was removed during the conversion process. Is it the expected behavior, or this is a bug of GroupDocs.Metadata library?


#9

@Glority_Developer,

Thanks for coming back.

Please update and get subject’s value using following code snippet are provide your feedback.

using (TiffFormat tiff = new TiffFormat(@"D:\Flowerboy_orginal.tif"))
{
    tiff.XmpValues.Schemes.DublinCore.SetSubject("test subject");
    tiff.Save(@"D:\Flowerboy_orginal_output.tif");
}

using (TiffFormat tiff = new TiffFormat(@"D:\Flowerboy_orginal_output.tif"))
{
    foreach (string dublinCoreSubject in tiff.XmpValues.Schemes.DublinCore["dc:subject"].ToStringArray())
    {
        Console.WriteLine(dublinCoreSubject);
    }
}

Would you please further explain the conversion process?


#10

@Glority_Developer,

The issues you have found earlier (logged as METADATANET-2418 and METADATANET-2420 ) has been fixed in this release.