TIF - Bit Depth will be affected when removing metadata


#1

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)


#2

@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.


#3

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


#4

@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?


#5

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)


#6

@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.


#8

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


#9

@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.


#10

@Glority_Developer,

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


#11

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.


#12

@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");

#13

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.


#14

@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.


#15

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


#16

@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.


#17

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


#18

@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.


#19

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


#20

@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.


#21

@Glority_Developer,

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