Read Media
read_mediaDownload media bytes to view Gramps Web photos, scans, or audio; default thumbnail renders a JPEG preview, while file mode returns the original.
Instructions
Download a media file's bytes so you can see it. Default mode thumbnail renders a JPEG preview (PNG when transparent) from an image original as MCP image content, 1568 pixels on the long edge unless size is given; EXIF and other metadata are stripped. Prefer it for reading photos and document scans; region shows one part of an image, as a media link with that region does. Use mode file only when the original is needed: returns image, audio, or embedded blob resource content according to MIME type. Requires GRAMPS_MEDIA_RESOURCES_ENABLED=true and respects size and private-record safeguards. For the media record itself (path, description, links) use get_object; to change it use update_media.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Download mode: thumbnail | file. Default thumbnail. Use file only when a preview is insufficient. | thumbnail |
| size | No | Thumbnail long edge in pixels, 1 to 4096; default 1568, which keeps handwriting and small print legible. Use 512 or less for a quick look at photos. Images are never upscaled. Only valid for mode thumbnail; omit for mode file. | |
| handle | Yes | The media object to show. Handle or Gramps ID (e.g. I0001), resolved automatically; find it with search or list_objects. | |
| region | No | Show only this part of the image, at up to size pixels on its long edge: [left, top, right, bottom] in percent of the image width and height, 0 to 100, from the top-left corner, as stored on a media link. Use it to check a region before saving it in mediaHandles or attachTo, or to read one record on a page scan. Only valid for mode thumbnail. |