Reading Metadata from a File
Posted: 18 Feb 2021 12:01
Hello Thomas,
I am in the process of studying GDI+.
I am trying to read the metadata of a file, using this link as an example:
https://docs.microsoft.com/en-us/window ... tadata-use
This is my code so far.
I get this result, which looks good.
ImagepropertyId = propertyItem(315,4,2,0268A940)
ImagepropertyId = propertyItem(36867,20,2,0268A944)
ImagepropertyId = propertyItem(36868,20,2,0268A958)
ImagepropertyId = propertyItem(37521,3,2,0268A96C)
ImagepropertyId = propertyItem(37522,3,2,0268A96F)
ImagepropertyId = propertyItem(40093,8,1,0268A972)
ImagepropertyId = propertyItem(20625,128,3,0268A97A)
ImagepropertyId = propertyItem(20624,128,3,0268A9FA)
Slightly clearer (I have omitted redundant items).
PropId = 315
VarArraySize = 4
Type = 2 = propertyTagTypeASCII
VarArray = 0264A940
......
......
PropId = 40093
VarArraySize = 8
Type = 1 = propertyTagTypeByte
VarArray = 0264A972
PropId = 20625
VarArraySize = 128
Type = 3 = propertyTagTypeShort
VarArray = 0264A97A
I understand that there is an array for every propertyitem.
From each array we know the arraypointer, the arraysize and the type of the arrayvalue ( the propertytagtype).
My question is : how can I read each array?
Kind regards,
Ben
I am in the process of studying GDI+.
I am trying to read the metadata of a file, using this link as an example:
https://docs.microsoft.com/en-us/window ... tadata-use
This is my code so far.
Code: Select all
doDraw(_Graphics, "Reading and Writing Metadata") :-
Image = image::createFromFile(@"vlinder.jpg"),
Image:getPropertySize(TotalBufferSize, NumberOfProperties),
L = Image:getAllPropertyItems(TotalBufferSize, NumberOfProperties),
foreach ItemId in L do
stdio::write("ImagepropertyId = ", ItemId, "\n")
end foreach,
%
foreach ItemId in L do
ItemId = gdiplus::propertyItem(PropId, VarArraySize, Type, VarArray),
stdio::write("\nPropId = ", PropId, "\nVarArraySize = ", VarArraySize, "\nType = ", Type, " = "),
stdio::write("\n", help(Type), "\nVarArray = ", VarArray, "\n")
end foreach,
!.
ImagepropertyId = propertyItem(315,4,2,0268A940)
ImagepropertyId = propertyItem(36867,20,2,0268A944)
ImagepropertyId = propertyItem(36868,20,2,0268A958)
ImagepropertyId = propertyItem(37521,3,2,0268A96C)
ImagepropertyId = propertyItem(37522,3,2,0268A96F)
ImagepropertyId = propertyItem(40093,8,1,0268A972)
ImagepropertyId = propertyItem(20625,128,3,0268A97A)
ImagepropertyId = propertyItem(20624,128,3,0268A9FA)
Slightly clearer (I have omitted redundant items).
PropId = 315
VarArraySize = 4
Type = 2 = propertyTagTypeASCII
VarArray = 0264A940
......
......
PropId = 40093
VarArraySize = 8
Type = 1 = propertyTagTypeByte
VarArray = 0264A972
PropId = 20625
VarArraySize = 128
Type = 3 = propertyTagTypeShort
VarArray = 0264A97A
I understand that there is an array for every propertyitem.
From each array we know the arraypointer, the arraysize and the type of the arrayvalue ( the propertytagtype).
My question is : how can I read each array?
Kind regards,
Ben