| Name | Type | Description |
|---|---|---|
path* | pathlib.Path | Path whose suffix is inspected. |
Return whether a path's extension is a known image or video extension.
This is a cheap, extension-only check (no file read or decode). Use it to classify a dropped file path as media without loading it, e.g. to reject a dragged image in a text-only input.
It is a heuristic, not a support check, and disagrees with the loaders in
both directions: get_image_from_path accepts anything Pillow can decode
regardless of extension, while get_video_from_path additionally requires a
recognized magic-byte signature. Call get_media_from_path when the answer
must match what can actually be attached.