Skip to main content
Vane Data / Reference

image_file_metadata

image_file_metadata inspects bounded IMAGEFILE headers without decoding pixels.

Signature

example.py
vane.image_file_metadata(value, *, max_bytes=1048576, max_pixels=100000000) -> Expression

SQL: image_file_metadata(file [, max_bytes [, max_pixels]]). Expression method: expr.image_file_metadata(...).

Parameters

NameTypeDescriptionDefault
valueIMAGEFILE value or ExpressionEncoded image object to inspectRequired
max_bytesInteger or ExpressionBounded header/probe budget1 MiB (maximum 64 MiB)
max_pixelsInteger or ExpressionDeclared-dimension limit100,000,000

Returns and errors

Returns STRUCT(width UINTEGER, height UINTEGER, format VARCHAR, mode VARCHAR). NULL inputs return NULL; unreadable or unsupported headers raise.

Example

example.py
import vane


con = vane.connect()
con.sql("SELECT image_file_metadata(image_file('photo.png'))").show()