Pictures MetaData
Hi,
I recorded a function to change MetaData value of my image. I need to use this to store 2 importants values for each captured image.
I recorded a function to change MetaData value of my image. I need to use this to store 2 importants values for each captured image.
Private Sub SetMetaData(ByVal CalibrationSpacial As String, ByVal MagnificationValue As String)
Dim doc1
With Application.Gadgets.DocumentProperties(m_SimpleScript)
.CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
.Run()
End With
With Application.DocumentCommands.Active(m_SimpleScript)
.Run(doc1)
End With
With Application.DocumentCommands.Properties(m_SimpleScript)
.Title = CalibrationSpacial
.Owner = MagnificationValue
.Run(doc1)
End With
End Sub
In IPP I can see that the value has been applied, but when I save as the picture, and after that when i'm going with Windows File Explorer to check image properties...the metadata are empty.
Thanks,
Martin
0
Answers
-
Hi Martin,
This is very much dependent on the file format and the software used to read the properties, so I would recommend to put your data in the Description field if you want it to be visible in Windows Explorer. Otherwise note that the calibration information will be saved automatically in TIFF files, and you can also save it separately in an .IQC file.
Pierre0 -
Hi Pierre,
I tried with "Description" but I'm facing the same problem.
I did some test, manually, and no metadata are saved if I use JPG format. If I use TIFF format, metadata are saved (tested using the Title and Description).
Is it an issue with IPP ?
Here's the steps I did :
- Open an image
- Show document properties
- Add in Title "Title test 1-2-3"
- Add in description "Description test 1-2-3"
- Save As in JPG format
- Save As in TIFF format
- Reopen both files
In the document properties of JPG file...no metadata saved...in TIFF file...everything is there.
In Windows Explorer, it works also only for the TIFF file ; I can see the value I entered in "Description" as a part of Title and Subject tag.
My client do not want to use TIFF format.
Thanks,
Martin0 -
Hi Martin,
We typically don't use JPEG because it is lossy, and currently Image-Pro Premier does not support writing metadata in JPEG files.
As a workaround I suggest that you use the .NET API to write the metadata of your choice, here is a function that will do that.
PierreImports System.Drawing Public Module Macros Public Sub Test1 SetDescription(ThisApplication.ActiveDocument.FileName,"D:\Test.jpg") End Sub Public Sub SetDescription(inFile As String, outFile As String) ' http://msdn.microsoft.com/en-us/library/ms534415(VS.85).aspx Dim ImageDescription As Integer = &H010E Dim jpgImage As Image = Image.FromFile(inFile) Dim data() As Byte = system.Text.Encoding.UTF8.GetBytes("My comment") ' Get a Property from the image file And use it As container Dim pi As System.Drawing.Imaging.PropertyItem = jpgImage.PropertyItems(0) ' Set the values ' http://msdn.microsoft.com/en-us/library/system.drawing.imaging.propertyitem.aspx pi.Type = 2 pi.Id = ImageDescription pi.Len = data.Length-1 pi.Value = data jpgImage.SetPropertyItem(pi) jpgImage.Save(outFile) End Sub
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions