Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
  • PyFlink Multimodal
    • Image
    • Video
    • Utilities
  • PyFlink DataStream
  • PyFlink Common

pyflink.multimodal.operators.is_valid_image#

is_valid_image(*columns, mode=None, pixel_limit=None, concurrency=None)[source]#

Check if an image can be decoded by the multimodal image codec.

The returned predicate is intended for DataFrame.filter before image_decode in fetch/decode pipelines.

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. None uses 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))

previous

pyflink.multimodal.operators.image_hash

next

pyflink.multimodal.operators.image_size_filter

Show Source

Created using Sphinx 4.5.0.