Skip to main content

mr resource preview

Download a server-rendered thumbnail preview of a Resource. -w, --width and --height set the target size, each capped at 600. Give both and the thumbnail is exactly that many pixels, so the aspect ratio is not preserved; give one and the other is derived from the resource's aspect ratio; give neither and the image is scaled to fit 600x600 and never upscaled. Not every content type supports previews (e.g., some binary formats or failed decodes). A Resource with no available preview redirects to the server's generic placeholder image, which the CLI follows, so the command still writes a file and exits 0.

Usage

mr resource preview <id>

Positional arguments:

  • <id>

Examples

Default preview

mr resource preview 42 -o preview.jpg

Exactly 256x256

mr resource preview 42 -o preview.jpg -w 256 --height 256

Flags

FlagTypeDefaultDescription
--outputstring``Output file path (default: preview_<id>)
--widthuint0Preview width
--heightuint0Preview height

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Exit Codes

0 on success; 1 on any error

See Also