ScanBlob (open)
Scan a blob and explain its contents.
Syntax
LOADLIB "wh::files.whlib";
RECORD FUNCTION ScanBlob(BLOB toscan, STRING filename, RECORD options)Parameters
BLOB toscanBlob to scan
STRING filenameFilename associated with the blob, if known. This may help detection of some file formats
RECORD optionsOptions
BOOLEAN extractdominantcolorIf TRUE, extract the dominant color from images
BOOLEAN generatehashIf TRUE, calculate the hash of the data
STRING mimetypeForce the mimetype to the requested type
Return value
RECORDA record describing the scanned blob
STRING dominantcolorImage's dominant color as a #RRGGBB code, 'transparent' if the image is transparent. Only extracted if the extractdominantcolor option is enabled
STRING extensionThe proper or usual extension for the file's mimetype, if known to webhare. Either empty or a text starting with a dot ('.')
STRING hashUFS encoded SHA-256 hash of the file. Only calculated if the generatehash option is enabled
INTEGER heighImage height (in pixels)
STRING mimetypeThe mimetype for the file. If unrecognized, application/octet-stream
BOOLEAN mirroredTrue if this is a mirrored image
RECORD refpointReference point if set, default record otherwise
INTEGER refpoint.xX coordinate of reference point (in pixels)
INTEGER refpoint.yY coordinate of reference point (in pixels)
INTEGER rotationImage rotation in degrees (0,90,180 or 270)
INTEGER widthImage width (in pixels)