TIF - Bit Depth will be affected when removing metadata in .NET

When we try to remove metadata of TiF files, we found that the Bit Depth is affected. It should not be affected since it will change the color of the file. See attached TIF files.

TIF.zip (1.7 MB)

@Glority_Developer,

Can you please elaborate the process you have been following to remove the metadata of the Tif files. I can gather from the images from the folder that one of them is the original image and the one with slightly different colors is what you receive after removing the metadata. How do you get the third image(the black and white one)?. Looking forward to hear from you.

The black and white one is created by GroupDocs metada library.
The windows_data_removal one is using Windows “Remove Properties and Personal Information” option within the Properties>Details tab

@Glority_Developer,

We are unable to reproduce the issue at our end. Can you please paste the sample code you are using to clear the metadata of the attached file?

We have wrote the test code as below, we only get the ExifInfo of the TIF file and UpdateExifInfo with original data, but the image is corrupted, we found the depth of the file is changed from 24 to 1 and some other changes.

using GroupDocs.Metadata;
using GroupDocs.Metadata.Formats.Image;

namespace MetadataTest
{
class Program
{
static void Main(string[] args)
{
string licenseFilePath = @“C:\Users\User\Desktop\MetadataTest\MetadataTest\MetadataTest\License\GroupDocs.Metadata.lic”;
string sourcePath = @“C:\Users\User\Desktop\MetadataTest\MetadataTest\MetadataTest\Source\Flowerboy_orginal.tif”;
string destinationPath = @“C:\Users\User\Desktop\MetadataTest\MetadataTest\MetadataTest\Destination\Flowerboy_orginal.tif”;

        License lic = new License();
        lic.SetLicense(licenseFilePath);

        TiffFormat format = new TiffFormat(sourcePath);
        if (format == null)
        {
            return;
        }

        ExifInfo exifInfo = format.ExifValues;
        format.UpdateExifInfo(exifInfo);
        format.Save(destinationPath);
    }
}

}

image.png (184.2 KB)

@Glority_Developer,

Thank you for explaining the issue. We have logged this issue in our internal tracking system under ID “METADATANET-1931” and will let you know once the issue is resolved.

We have verified in v17.10.1, it is not fixed. It will still change TIF files to black and white.

@Glority_Developer,

Thanks for using GroupDocs.Metadata API v17.10.1. We have logged your concerns in our issue tracking system. In case of any updates, we will inform you.

@Glority_Developer,

The issue you have found earlier (filed as METADATANET-1931) has been fixed in this update.

Hi @usman.aziz,

We tested in latest 18.4, we tried remove() function to remove MicrosoftPhoto:CameraSerialNumber, it can remove this property, but it will change Bit depth, Compression, Resolution unit, Photometric interpretation Size fields. This will also make the image broken and can’t show correctly.

So this is still a problem and needs to be fixed.

Notes: we also tried addvalue() function to clear MicrosoftPhoto:CameraSerialNumber, it also has this problem.

@Glority_Developer

Thanks for coming back, we investigated your issue and we are unable to reproduce it our end. Furthermore, please use following code snippet to remove MicrosoftPhoto:CameraSerialNumber and provide us with your valuable feedback.

// initialize TiffFormat
TiffFormat tiffFormat = new TiffFormat("D:\\Flowerboy_orginal.tif");

//remove Xmp Properties
tiffFormat.RemoveXmpData();

// commit changes and save output file
tiffFormat.Save("D:\\output\\Flowerboy_orginal.tif");

We try function RemoveXmpData() to remove xmp data, it can remove all xmp data but it turn the Tiff image into black.
Notes:We just using this function and nothing else.

@Glority_Developer

Thanks for your feedback. We are still unable to reproduce your issue at our end using the sample file you provided earlier. Please share the following details with us so that we can further investigate this issue at our end:

  • Operation System details
  • .NET framework version
  • Sample files(In case you are using different sample files)
  • A simple console application (source code without compilation errors) that can help us to reproduce the issue at our end

We shall be looking forward to hearing from you.

System : Windows 7 64bit
.NET framework version : 4.5
Sample files : test1.zip (886.5 KB)

@Glority_Developer,

Thanks for providing details. Your reported issue has been reproduced and we have logged this issue in our issue tracking system (with ID: METADATANET-2303).
Please note that issue was reproduced by recently shared sample file and was not reproducible with the earlier one.

Hi @ali.ahmed
Do you get any feedback when this will be fixed?

@Glority_Developer,

Thanks for coming back, the fix for your issue (with ID: METADATANET-2303) will be available in the next version of the API. Please stay tuned for any further updates.

Thanks. Do you have any plan when the next release will be?

@Glority_Developer,

GroupDocs.Metadata for .NET 18.6 is expected to be released in first half of June. Once the release is on-board, we’ll notify you here.

@Glority_Developer,

The issue you have found earlier (filed as METADATANET-2303) has been fixed in this update.