pyflink.multimodal.operators.is_valid_image#
- is_valid_image(*columns, mode=None, pixel_limit=None, concurrency=None)[source]#
Check if an image passes lightweight validity checks.
For encoded bytes this uses header/container verification and does not guarantee that the full pixel stream can be materialized. Use
image_decode(on_error="null")when corrupt bytes should become null instead of failing.- Parameters
*columns – Optional image columns. When provided, the UDF is applied directly (syntactic sugar).
mode – Optional target mode to validate against, e.g.
"RGB".pixel_limit – Maximum allowed
width * height. Images exceeding this limit are treated as invalid.concurrency – UDF concurrency.
Noneuses the framework default.
- Returns
A UDF producing
boolean.
- Example::
>>> # As a reusable variable >>> valid = is_valid_image(pixel_limit=4096 * 4096) >>> df = df.filter(valid(col("content"))) >>> >>> # Inline >>> df = df.filter(is_valid_image(col("content"), pixel_limit=4096 * 4096))