pyflink.multimodal.operators.image_metadata#
- image_metadata(*columns, concurrency=None)[source]#
Extract metadata (width, height, channels, mode, encoded format) from an image.
modereports the image’s channel/precision mode: Pillow’s mode string for raw encoded bytes, or the canonical mode ("L","LA","RGB","RGBA","L16") for decodedImageinput.formatdescribes the encoded container for raw bytes. For decodedImageinput it is"UNKNOWN"because the internal pixel value intentionally does not retain original encoding metadata. Apply format filters to raw encoded bytes beforeimage_decodewhen the original container format matters.- 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")))