Image Results¶
Typification of the image results. Results of this type are rendered in the images.html template.
- final class searx.result_types.image.Image(title: str = '', content: str = '', img_src: str = '', iframe_src: str = '', audio_src: str = '', thumbnail: str = '', publishedDate: datetime | None = None, pubdate: str = '', length: timedelta | None = None, views: str = '', author: str = '', metadata: str = '', priority: Literal['', 'high', 'low']='', engines: set[str] = <factory>, open_group: bool = False, close_group: bool = False, positions: list[int] = <factory>, score: float = 0, category: str = '', *, template: str = 'images.html', url: str | None = None, engine: str | None = '', parsed_url: ParseResult | None = None, thumbnail_src: str = '', resolution: str = '', img_format: str = '', source: str = '', filesize: str = '', formats: list[ImageRef] = <factory>)[source]¶
Bases:
MainResultResult type suitable for displaying images.
The images are displayed as small thumbnails in the main results list. Clicking on the preview opens a gallery view in which all further metadata for the image is displayed.
- filter_urls(filter_func: Callable[[Result | LegacyResult, str, str], str | bool])[source]¶
A filter function is passed in the
filter_funcargument to filter and/or modify the URLs.The filter function receives the
result objectas the first argument and the field name (str) in the second argument. In the third argument the URL string value is passed to the filter function.The filter function is applied to all fields that contain a URL, in addition to the familiar
urlfield, these include fields such as:["url", "iframe_src", "audio_src", "img_src", "thumbnail_src", "thumbnail"]
and the
urlslist of items of the infobox.For each field, the filter function is called and returns a bool or a string value:
True: leave URL in field unchangedFalse: remove URL field from result (or remove entire result)str: modified URL to be used instead
See Filter URLs example.
- class searx.result_types.image.ImageRef(*, url: str, subtype: Literal['png', 'svg+xml', 'jpeg', 'bmp', 'x-icon', 'tiff'], label: str = '', mtype: Literal['image'] = 'image')[source]¶
Reference to an (alternative) image format