
CHAPTER 10: Scripting Access to XMP Metadata XMPScript object reference 269
XMPFile class functions
This function is available as a static method of the XMPFile class. It is not necessary to create an instance to
call it.
XMPFile object functions
getFormatInfo()
XMPFile.getFormatInfo(format)
format
The file format constant. See “File format numeric constants” on page 264.
Reports the supported features for the given file format.
Returns a logical OR of bit-flag constants, or 0 if the format is not handled. Constants are:
XMPConst.HANDLER_CAN_INJECT_XMP — Can inject first-time XMP into an existing file.
XMPConst.HANDLER_CAN_EXPAND — Can expand XMP or other metadata in an existing file.
XMPConst.HANDLER_CAN_REWRITE — Can copy one file to another, writing new metadata.
XMPConst.HANDLER_PPEFERS_IN_PLACE — Can expand, but prefers in-place update.
XMPConst.HANDLER_CAN_RECONCILE — Supports reconciliation between XMP and other forms.
XMPConst.HANDLER_ALLOWS_ONLY_XMP — Allows access to just the XMP, ignoring other forms.
XMPConst.HANDLER_RETURNS_RAW_PACKETS —
File handler returns raw XMP packet information.
XMPConst.HANDLER_RETURNS_TNAIL — File handler returns native thumbnail.
XMPConst.HANDLER_OWNS_FILE — File handler does the file open and close.
XMPConst.HANDLER_ALLOWS_SAFE_UPDATE — File handler allows crash-safe file updates.
XMPConst.HANDLER_NEEDS_READONLY_PACKET —
File format needs XMP packet to be read-only.
XMPConst.HANDLER_USES_SIDECAR_XMP — Fle handler uses a sidecar file for the XMP.
canPutXMP()
XMPFileObj.canPutXMP(xmpObj)
XMPFileObj.canPutXMP(xmpPacket)
XMPFileObj.canPutXMP(xmpBuffer)
xmpObj
The XMP metadata as an XMPMeta object.
xmpPacket
The XMP metadata as a string containing an XMP packet.
xmpBuffer
The XMP metadata as an Array of Number containing raw XMP packet data.
Reports whether XMP metadata of a given size can be updated for this file. This is particularly
important if the packet size is increased.
Considers only the length of the serialized packet; does not keep the provided XMP. Use putXMP()
to
actually update the XMP in the open file.
Returns true if the given XMP can be put into this file.
Comentários a estes Manuais