DDMAL / DDMAL/cantus

Search-result thumbnails and click-to-focus broken for Liber Usualis: neume component bounding boxes are always `(-1,-1,0,0)`

Open
#1,006 0 comments 0 reactions 2 assignees Claimed by @etosphere View on GitHub
Dominant language
JavaScript
Stars
16
Forks
4
Avg merge
2d 16h
Merged PRs (30d)
3

Description

On the Liber Usualis manuscript (staging, ID `991961`), every neume/pitch search result shows a broken-image icon in place of the usual small pitch/neume-sequence thumbnail, and clicking it does nothing (no zoom/highlight on the main viewer).

Liber Usualis's MEI encodes `@facs` on the parent `` element, not on individual `` children. Since `_get_element_zone` only ever checks the `` itself, it finds no `facs` there for every Liber Usualis neume component, and outputs (-1,-1,-1,-1) as coordinates. `combine_bounding_boxes`/`combine_bounding_boxes_single_system` then propagate this untouched, producing the `w:0, h:0, x:-1, y:-1` seen in every search result.

## Root cause

`app/public/cantusdata/helpers/mei_processing/mei_parser.py`:

```python
def _get_element_zone(self, element: etree._Element) -> Zone:
"""
Get the coordinates of an element, returning
(-1,-1,-1,-1) if none are found.
"""
facs = element.get("facs")
if facs:
zone = self.zones.get(facs, {"coordinates": (-1, -1, -1, -1), "rotate": 0.0})
return zone
return {"coordinates": (-1, -1, -1, -1), "rotate": 0.0}
```

`_parse_neume_component_element` (same file) calls this directly on the `` element:

```python
"bounding_box": self._get_element_zone(neume_comp),
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.