Could you please attach TIFF sample file? Also, what version of Graphics Mill you are using?
Regards, Andrew
Hi Andrew, I´m trying upload the tiff image but I´m having problems. I have tried compressing with zip but I have the same problems uploading. The smallest image I have is 9Mb.
Could you please attach TIFF sample file? Also, what version of Graphics Mill you are using?
Regards, Andrew
Hi Andrew, I´m trying upload the tiff image but I´m having problems. I have tried compressing with zip but I have the same problems uploading. The smallest image I have is 9Mb.
using (var tiffReader = new TiffReader(@"Images\input.tif"))
using (var tiffWriter = new TiffWriter(@"Images\output.tif"))
{
XmpData xmp = new XmpData();
tiffWriter.Xmp = xmp.Save();
Pipeline.Run(tiffReader + tiffWriter);
}
Andrey Semenov;32605 You can do something like this:
using (var tiffReader = new TiffReader(@"Images\input.tif"))
using (var tiffWriter = new TiffWriter(@"Images\output.tif"))
{
XmpData xmp = new XmpData();
tiffWriter.Xmp = xmp.Save();
Pipeline.Run(tiffReader + tiffWriter);
}
Regards, Andrew
Thanks Andrew. There is no way to remove the XMP in the input image without save a new file..?? I have big images, the most of them over 100Mb in a network environment. Thanks again.
Franchi_S5;32606 Thanks Andrew. There is no way to remove the XMP in the input image without save a new file..?? I have big images, the most of them over 100Mb in a network environment. Thanks again.
It is possible to read existing file in memory and then rewrite it, e.g.:
using (var bitmap = new Bitmap(@"Images\input.tif"))
using (var tiffWriter = new TiffWriter(@"Images\input.tif"))
{
XmpData xmp = new XmpData();
tiffWriter.Xmp = xmp.Save();
Pipeline.Run(bitmap + tiffWriter);
}
Franchi_S5;32606 Thanks Andrew. There is no way to remove the XMP in the input image without save a new file..?? I have big images, the most of them over 100Mb in a network environment. Thanks again.
It is possible to read existing file in memory and then rewrite it, e.g.:
using (var bitmap = new Bitmap(@"Images\input.tif"))
using (var tiffWriter = new TiffWriter(@"Images\input.tif"))
{
XmpData xmp = new XmpData();
tiffWriter.Xmp = xmp.Save();
Pipeline.Run(bitmap + tiffWriter);
}
Hi again Andrey. I have tested the last code and it doesn´t change the input image. I have no error but the input image has no change. I don´t understand why...
using (var reader = new Aurigma.GraphicsMill.Bitmap(fichero.FullName))
using (var writer = new TiffWriter(fichero.FullName))
{
XmpData xmp = new XmpData();
writer.Xmp = xmp.Save();
Pipeline.Run(reader + writer);
}
Could you please attach TIFF sample file? Also, what version of Graphics Mill you are using?
Regards, Andrew
Hi Andrew, I´ve been checking my code and I have a strange error when I save the Xmp to the TiffWriter
var exif = new ExifDictionary();
var iptc = new IptcDictionary();
if (procesar_exif == false)
{
exif = reader.Exif;
exif.Remove(ExifDictionary.Thumbnail);
writer.Exif = exif;
}
else
{
exif = reader.Exif;
exif.Remove(ExifDictionary.Thumbnail);
if (reader.Iptc != null) iptc = reader.Iptc;
if (checkBoxEXIF.Enabled) writer.Exif = InsertarEXIF(exif);
if (checkBoxIPTC.Checked) writer.Iptc = InsertarIPTC(iptc);
if (reader.Xmp != null)
{
writer.Xmp = reader.Xmp;
}
else
{
XmpData xmp = new XmpData();
InsertarXMP(xmp);
writer.Xmp = xmp.Save();
}
}
And here is my InsertarXMP method:
private void InsertarXMP(XmpData xmp)
{
if (textBoxXMP_Ciudad.Text != "")
{
if (xmp.Contains(XmpTagNames.PhotoshopCity))
{
xmp.Remove(XmpTagNames.PhotoshopCity);
}
var node = new XmpValueNode(XmpNodeType.SimpleProperty, textBoxXMP_Ciudad.Text, XmpTagNames.PhotoshopCity);
xmp.AddNode(node);
}
if (textBoxXMP_Provincia.Text != "")
{
if (xmp.Contains(XmpTagNames.PhotoshopState))
{
xmp.Remove(XmpTagNames.PhotoshopState);
}
var node = new XmpValueNode(XmpNodeType.SimpleProperty, textBoxXMP_Provincia.Text, XmpTagNames.PhotoshopState);
xmp.AddNode(node);
}
if (textBoxXMP_Pais.Text != "")
{
if (xmp.Contains(XmpTagNames.PhotoshopCountry))
{
xmp.Remove(XmpTagNames.PhotoshopCountry);
}
var node = new XmpValueNode(XmpNodeType.SimpleProperty, textBoxXMP_Pais.Text, XmpTagNames.PhotoshopCountry);
xmp.AddNode(node);
}
if (textBoxXMP_Web.Text != "")
{
if (xmp.Contains(XmpTagNames.XmpRightsWebStatement))
{
xmp.Remove(XmpTagNames.XmpRightsWebStatement);
}
var node = new XmpValueNode(XmpNodeType.SimpleProperty, textBoxXMP_Web.Text, XmpTagNames.XmpRightsWebStatement);
xmp.AddNode(node);
}
}
When I´m in debugging, and after writer.Xmp = xmp.Save(); I have checked that all the strange characters that I told you in my first question are stored just after this line.
I don´t know if I have done something wrong or this could be an error in the GM Library.
I see only EXIF metadata in this file. Could you please attach a file with XMP entries which should be removed?
Hi Andrew,
I have been checking the attached TIFF and I can see the Metadata section with the strange characters. I use the Xnview image viewer, it´s a free Image Viewer. If you open the image with Xnview and once opened double click over the image you will see the XMP section. Anyway, we use too a standard Digital Objects Validation, the name is Jhove, this is the mandatory tool we must use before sending images to our clients. This tool validate the image and export a XML file with the information about this validation.
Attached I send to you the XML file with the validation of the TIFF image. At the end of the XML file you will see the characters that I told you. It´s very very strange. I have only seem this problem after process the images with GM library adding XMP Metadata. Anyway, it may be my mistake, but I would need to know what I´m doing wrong.
I attached too the original TIFF before processing and the XML file after validation of this image. Here you will see the image doesn´t have XMP Metadata inside.
I didn´t write the code for validation. The Validation Tool is Jhove. It´s a standard app created for Digital Objects Validation and it´s approved by the Library of Congress. You can find it here: http://jhove.sourceforge.net/index.html
If you download the app and extract it from the downloaded .zip you can run the jhove-gui.bat. Then drag and drop the TIFF image over the GUI of the app and will show you the result of the validation. You can export the result as XML too.
We usually use this tool every day for checking all our images. It´s mandatory for all our Projects because the Libraries and Arquives require of this validation. I have never see this strange characteres, only after processing the image with GM. And what I don´t understand is that Xnview show me that strange characteres too.
May be a Jhove bug? May be a Xnview bug? May be a GM bug? I don´t know but I´m going crazy 🤦
I can´t understand why your screenshot is XMP empty. Could your screenshot belongs to the MASTER TIFF (before processing) instead of the TIFF processed with G.M. ?? The screenshot I sent you was with Xnview too.