pyflink.multimodal.operators.image_metadata#
- image_metadata(*columns, concurrency=None)[source]#
Extract metadata (width, height, channels, mode) from an image.
Accepts decoded Image values and encoded image bytes. For decoded input,
modereports the canonical Image mode andformatis"UNKNOWN". For encoded bytes, metadata is read from the container header; corrupt bytes returnNone. Encoded-byte metadata is lightweight and does not guarantee that the full pixel stream can be materialized.- Parameters
*columns – Optional image columns. When provided, the UDF is applied directly (syntactic sugar).
concurrency – UDF concurrency.
Noneuses the framework default.
- Returns
A UDF producing an object with
width,height,channels,mode, andformatfields.
- Example::
>>> # As a reusable variable >>> metadata = image_metadata() >>> df = df.with_columns("meta", metadata(col("img"))) >>> >>> # Inline >>> df = df.with_columns("meta", image_metadata(col("img")))