XMPScannerMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

XMPScannerMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class XMP MBS XMP Plugin 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The class to scan any file stream for XMP data.
Example
dim c,n,i,l as Integer
dim xs as XMPScannerMBS
dim xn as XMPSnipMBS
dim s as string
dim x as XMPMetaMBS
dim b as BinaryStream
dim source as FolderItem

// get file
source=GetOpenFolderItem("any")
if source=nil then Return

b=source.OpenAsBinaryFile(false)

if b=nil then Return

// read file to memory
l=b.Length
s=b.Read(l)

// scan for xmp blocks
MsgBox "Scanning "+str(lenb(s))+" of "+str(l)+" bytes."

xs=new XMPScannerMBS(l)
xs.Scan(s,0)

MsgBox "Found "+str(xs.Report)+" blocks"

n=xs.Report-1

c=0
for i=0 to n

xn=xs.Snip(i)

if xn.State=3 then // found
if xn.Length>50 then
try
b.Position=xn.Offset

s=b.Read(xn.Length)

// debug output xmp data
'WriteInputXMP dest,s

// try to parse
x=new XMPMetaMBS(s)

// work with xmp meta data
catch r as XMPExceptionMBS
MsgBox "ExtractXMP failed on: "+r.message
end try
else
MsgBox "Found small xmp block? "+str(xn.Length)
end if
end if
next

This class has no sub classes.


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


XMPPacketInfoMBS   -   XMPSnipMBS


💬 Ask a question or report a problem