Platforms to show: All Mac Windows Linux Cross-Platform

Back to XMPMetaMBS class.

Previous items

XMPMetaMBS.ParseFromBuffer(buffer as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
ParseFromBuffer parses RDF from a series of input buffers.

The buffers may be any length. The buffer boundaries need not respect XML tokens or even Unicode characters.

Parameters:
buffer Input data buffer. Termination of an input loop is convenient by passing kXMP_ParseMoreBuffers (2) for all real input, then having a final call with a zero length and kXMP_NoOptions.
options Options controlling the parsing.

The available options are:

kXMP_ParseMoreBuffers= 2This is not the last buffer of input, more calls follow.
kXMP_RequireXMPMeta= 1The x:xmpmeta XML element is required around rdf:RDF.
kXMP_StrictAliasing= 4Do not reconcile alias differences, throw an exception.

Note: The kXMP_StrictAliasing option is not yet implemented.

Some examples using this method:

XMPMetaMBS.RemoveProperties(schemaNS as string="", propName as string="", options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Remove multiple properties from an XMP object.

RemoveProperties was created to support the File Info dialog's Delete button, and has been been generalized somewhat from those specific needs. It operates in one of three main modes depending on the schemaNS and propName parameters:
Non-empty schemaNS and propName - The named property is removed if it is an external property, or if the kXMPUI_DoAllProperties option is passed. It does not matter whether the named property is an actual property or an alias.
Non-empty schemaNS and empty propName - The all external properties in the named schema are removed. Internal properties are also removed if the kXMPUI_DoAllProperties option is passed. In addition, aliases from the named schema will be removed if the kXMPUI_IncludeAliases option is passed.
Empty schemaNS and empty propName - All external properties in all schema are removed. Internal properties are also removed if the kXMPUI_DoAllProperties option is passed. Aliases are implicitly handled because the associated actuals are.
It is an error to pass and empty schemaNS and non-empty propName.

xmpObjThe XMP object containing the properties to be removed.
schemaNSOptional schema namespace URI for the properties to be removed.
propNameOptional path expression for the property to be removed.
optionsOption flags to control the deletion. The defined flags are: kXMPUI_DoAllProperties - Do internal properties in addition to external properties. kXMPUI_IncludeAliases - Include aliases in the "named schema" case above.

XMPMetaMBS.SeparateArrayItems(schemaNS as string, arrayName as string, options as Integer, catedStr as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Separate a single edit string into an array of strings.

Parameters:
xmpObjThe XMP object containing the array to be updated.
schemaNSThe schema namespace URI for the array. Must not be null or the empty string.
arrayNameThe name of the array. May be a general path expression, must not an empty string. Each item in the array must be a simple string value.
optionsOption flags to control the separation.
catedStrThe string to be separated into the array items.

Some examples using this method:

XMPMetaMBS.SerializeToBuffer(options as Integer, padding as Integer, newline as string, indent as string="", baseIndent as Integer=0) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SerializeToBuffer serializes an XMP object into a string as RDF.

Returns the serialized RDF.

Parameters:

optionsOption flags to control the serialization.
paddingThe amount of padding to be added if a writeable XML packet is created. If zero is passed (the default) an appropriate amount of padding is computed.
newlineThe string to be used as a line terminator. If empty it defaults to linefeed, U+000A, the standard XML newline.
indentThe string to be used for each level of indentation in the serialized RDF. If empty it defaults to two ASCII spaces, U+0020.
baseIndentThe number of levels of indentation to be used for the outermost XML element in the serialized RDF. This is convenient when embedding the RDF in other text.

The available option flags are:

kXMP_OmitPacketWrapper= &h10Do not include an XML packet wrapper.
kXMP_ReadOnlyPacket= &h20Create a read-only XML packet wapper.
kXMP_UseCompactFormat= &h40Use a highly compact RDF syntax and layout.
kXMP_WriteAliasComments= &h400Include XML comments for aliases.
kXMP_IncludeThumbnailPad= &h100Include typical space for a JPEG thumbnail in the padding if no xmp:Thumbnails property is present.
kXMP_ExactPacketLength= &h200The padding parameter provides the overall packet length. The actual amount of padding is computed. An exception is thrown if the packet exceeds this length with no padding.

The specified options must be logically consistent, an exception is thrown if not. You cannot specify both kXMP_OmitPacketWrapper along with kXMP_ReadOnlyPacket, kXMP_IncludeThumbnailPad, or kXMP_ExactPacketLength.
In addition, one of the following encoding options may be included:

kXMP_EncodeUTF8= 0Encode as UTF-8, the default.
kXMP_EncodeUTF16Big= 2Encode as big-endian UTF-16.
kXMP_EncodeUTF16Little= 3Encode as little-endian UTF-16.
kXMP_EncodeUTF32Big= 4Encode as big-endian UTF-32.
kXMP_EncodeUTF32Little= 5Encode as little-endian UTF-32.

See also:

Some examples using this method:

XMPMetaMBS.SerializeToBuffer(options as Integer=0, padding as Integer=0) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SerializeToBuffer serializes an XMP object into a string as RDF.
Example
dim x as new XMPMetaMBS
dim registeredPrefix as string

call x.RegisterNamespace ("xwnv", "xwnv", registeredPrefix)

x.SetProperty "xwnv","MZSTID","test"

MsgBox x.SerializeToBuffer

Same as other SerializeToBuffer method, but with newline="", indent=0 and baseIndent=0.

See also:

XMPMetaMBS.SetArrayItem(schemaNS as string, arrayName as string, itemIndex as Integer, itemValue as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetArrayItem provides access to items within an array.

The index is passed as an integer, you need not worry about the path string syntax for array items, convert a loop index to a string, etc. The array passed to SetArrayItem must already exist. See also AppendArrayItem.

In normal usage the selected array item is modified. A new item is automatically appended if the index is the array size plus 1. A new item may be inserted before or after any item by using one of the following option flags:

kXMP_InsertBeforeItem= &h4000Insert a new array item before the selected one.
kXMP_InsertAfterItem= &h8000Insert a new array item after the selected one.

Parameters:
schemaNS The namespace URI for the array. Has the same usage as in GetProperty.
arrayName The name of the array. May be a general path expression, must not be an empty string. Has the same namespace prefix usage as propName in GetProperty.
itemIndex The index of the desired item. Arrays in XMP are indexed from 1. The constant kXMP_ArrayLastItem always refers to the last existing array item.
itemValue An UTF-8 string that is the value of the array item, if the array item has a value. Has the same usage as propValue in GetProperty.
options Option flags describing the item. See the earlier description.

Some examples using this method:

XMPMetaMBS.SetLocalizedText(schemaNS as string, altTextName as string, genericLang as string, specificLang as string, itemValue as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetLocalizedText modifies the value of a selected item in an alt-text array.

Creates an appropriate array item if necessary, and handles special cases for the x-default item.

If the selected item is from a match with the specific language, the value of that item is modified. If the existing value of that item matches the existing value of the x-default item, the x-default item is also modified. If the array only has 1 existing item (which is not x-default), an x-default item is added with the given value.
If the selected item is from a match with the generic language and there are no other generic matches, the value of that item is modified. If the existing value of that item matches the existing value of the x-default item, the x-default item is also modified. If the array only has 1 existing item (which is not x-default), an x-default item is added with the given value.
If the selected item is from a partial match with the generic language and there are other partial matches, a new item is created for the specific language. The x-default item is not modified.
If the selected item is from the last 2 rules then a new item is created for the specific language. If the array only had an x-default item, the x-default item is also modified. If the array was empty, items are created for the specific language and x-default.

Parameters:
schemaNSThe namespace URI for the alt-text array. Has the same usage as in GetProperty.
altTextNameThe name of the alt-text array. May be a general path expression, must not be an empty string. Has the same namespace prefix usage as propName in GetProperty.
genericLang The name of the generic language as an RFC 3066 primary subtag.
specificLang The name of the specific language as an RFC 3066 tag. Must not be an empty string.
itemValue An UTF-8 string that is the new value for the appropriate array item.
options Option flags, none are defined at present.

Some examples using this method:

XMPMetaMBS.SetProperty(schemaNS as string, propName as string, propValue as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetProperty is the simplest property setter, mainly for top level simple properties or after using the path composition functions.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue An UTF-8 string that is the value of the property, if the property has a value. Arrays and non-leaf levels of structs do not have values.
options Option flags describing the property.

XMPMetaMBS.SetPropertyBoolean(schemaNS as string, propName as string, propValue as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyBoolean sets the value of a Boolean property from a boolean.

Parameters:
schemaNSThe namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The bool value to be assigned to the property.
options An integer variable that is assigned option flags describing the property.

See also:

Some examples using this method:

XMPMetaMBS.SetPropertyBoolean(schemaNS as string, propName as string, propValue as boolean, options as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyBoolean sets the value of a Boolean property from a boolean.

Parameters:
schemaNSThe namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The bool value to be assigned to the property.
options An integer variable that is assigned option flags describing the property.

See also:

XMPMetaMBS.SetPropertyDate(schemaNS as string, propName as string, propValue as XMPDateTimeMBS, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyDate sets the value of a date/time property from an XMPDateTimeMBS object.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The XMPDateTimeMBS object to be assigned to the property.
options Option flags describing the property.

Some examples using this method:

XMPMetaMBS.SetPropertyFloat(schemaNS as string, propName as string, propValue as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyFloat sets the value of a floating point property from a double.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The double float value to be assigned to the property.
options Option flags describing the property.

See also:

Some examples using this method:

XMPMetaMBS.SetPropertyFloat(schemaNS as string, propName as string, propValue as Double, options as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyFloat sets the value of a floating point property from a double.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The double float value to be assigned to the property.
options Option flags describing the property.

See also:

XMPMetaMBS.SetPropertyInt64Double(schemaNS as string, propName as string, propValue as Double, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyInt64Double sets the value of a 64 bit integer property from a double.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The double value to be assigned to the property.
options Option flags describing the property.

XMPMetaMBS.SetPropertyInteger(schemaNS as string, propName as string, propValue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyInteger sets the value of an integer property from an integer.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The long integer value to be assigned to the property.
options Option flags describing the property.

See also:

Some examples using this method:

XMPMetaMBS.SetPropertyInteger(schemaNS as string, propName as string, propValue as Integer, options as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetPropertyInteger sets the value of an integer property from an integer.

Parameters:
schemaNS The namespace URI for the property. Has the same usage as in GetProperty.
propName The name of the property. Has the same usage as in GetProperty.
propValue The long integer value to be assigned to the property.
options Option flags describing the property.

See also:

XMPMetaMBS.SetPropertyInteger64(schemaNS as string, propName as string, propValue as Int64, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the value of an integer property using an Int64.

Sets a property with a binary value, creating it if necessary.

schemaNS: The namespace URI; see GetProperty().
propName: The name of the property. Can be a general path expression, must not be "" or the empty string; see GetProperty() for namespace prefix usage.
propValue: The new binary value.
options: Option flags describing the property; a logical OR of allowed bit-flag constants; see kPropValueIsStruct and following. Must match the type of a property that already exists.

XMPMetaMBS.SetQualifier(schemaNS as string, propName as string, qualNS as string, qualName as string, qualValue as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetQualifier provides access to a qualifier attached to a property.

The namespace for the qualifier is passed as a URI, you need not worry about the path string syntax. In many regards qualifiers are like struct fields. See the introductory discussion of qualified properties for more information.

The names of qualifiers should be XML qualified names, that is within an XML namespace. The path syntax for a qualified name uses the namespace prefix, which is unreliable because the prefix is never guaranteed. The URI is the formal name, the prefix is just a local shorthand in a given sequence of XML text.

Parameters:
schemaNS The namespace URI for the struct. Has the same usage as in GetProperty.
propName The name of the property to which the qualifier is attached. Has the same usage as in GetProperty.
qualNS The namespace URI for the qualifier. Has the same URI and prefix usage as the schemaNS parameter.
qualName The name of the qualifier. Must be a single XML name, must not be an empty string. Has the same namespace prefix usage as the propName parameter.
qualValue An UTF-8 string that is the value of the qualifier, if the qualifier has a value. Has the same usage as propValue in GetProperty.
options Option flags describing the qualifier.

Some examples using this method:

XMPMetaMBS.SetStructField(schemaNS as string, structName as string, fieldNS as string, fieldName as string, fieldValue as string, options as Integer=0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 6.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
SetStructField provides access to fields within a nested structure.

The namespace for the field is passed as a URI, you need not worry about the path string syntax.

The names of fields should be XML qualified names, that is within an XML namespace. The path syntax for a qualified name uses the namespace prefix, which is unreliable because the prefix is never guaranteed. The URI is the formal name, the prefix is just a local shorthand in a given sequence of XML text.

Parameters:
schemaNS The namespace URI for the struct. Has the same usage as in GetProperty.
structName The name of the struct. May be a general path expression, must not be an empty string. Has the same namespace prefix usage as propName in GetProperty.
fieldNS The namespace URI for the field. Has the same URI and prefix usage as the schemaNS parameter.
fieldName The name of the field. Must be a single XML name, must not be null or the empty string. Has the same namespace prefix usage as the structName parameter.
fieldValue An UTF-8 string that is the value of the field, if the field has a value. Has the same usage as propValue in GetProperty.
options Option flags describing the field.

Some examples using this method:

XMPMetaMBS.Sort

Type Topic Plugin Version macOS Windows Linux iOS Targets
method XMP MBS XMP Plugin 9.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sorts the data model tree of an XMP object.

Use this function to sort the data model of an XMP object into a canonical order. This can be convenient when comparing data models, (e.g. by text comparison of DumpObject output).

At the top level the namespaces are sorted by their prefixes. Within a namespace, the top level properties are sorted by name. Within a struct, the fields are sorted by their qualified name, i.e. their XML prefix:local form. Unordered arrays of simple items are sorted by value. Language Alternative arrays are sorted by the xml:lang qualifiers, with the "x-default" item placed first.

Previous items

The items on this page are in the following plugins: MBS XMP Plugin.


The biggest plugin in space...