Documentation

view.php

Table of Contents

Functions

HookFacesViewCustompanels()  : bool
Adds a custom panel to the resource view page displaying detected faces and tagging options.

Functions

HookFacesViewCustompanels()

Adds a custom panel to the resource view page displaying detected faces and tagging options.

HookFacesViewCustompanels() : bool

This hook is is triggered during the view.php rendering process. It queries the resource_face table for any faces detected in the current resource, and if found, renders a table showing cropped face previews along with a dropdown to tag the face with a named person. It also includes a link to perform a face similarity search (!face<ID>).

Image dimensions are used to correctly crop and scale face previews for display using CSS background properties. Tagging actions invoke the faces_tag API via JavaScript to persist the selected person name (node) for each face.

Tags
global

array $lang Global language strings.

int $ref Resource ID being viewed.

string $baseurl Base URL of the ResourceSpace installation.

int $faces_tag_field The metadata field used to tag faces with person names.

uses
ps_query()
get_resource_path()
getimagesize()
get_resource_nodes()
generateURL()
generate_csrf_js_object()
Return values
bool

Returns false to allow further custom panels to be rendered after this one.

On this page

Search results