Skip to main content

looks_decodable

Function looks_decodable 

Source
pub fn looks_decodable(path: &Path) -> bool
Expand description

Whether this path looks like a picture this build can open.

By extension, and deliberately: this is asked once per entry while building a filmstrip for a folder, and opening every file in a directory to read a magic number turns listing it into as many opens as there are files — the same reasoning hyprforge_listing::types::EntryKind::classify gives for classifying by name.

So it can be wrong, in one direction that matters: a file this says yes to may still fail to decode, and the caller has to be ready for that. It is never the only check.