docs/cli/cv targets

CLI

cv targets

Print what a file can become, with what each conversion keeps and drops. It reads the file on your machine and uploads nothing.

Usage

The format comes from the file's content, so a wrong extension does not matter. --from answers for a format without a file.

Flag
--from <format>A format to answer for, or the format of the file when its content is recognized as the wrong one.
--jsonPrint one JSON object on stdout instead. See JSON and exit codes.
--api <url>The server, from CV_API_URL, or https://api.convert.dev.
--key <key>The API key, from CV_API_KEY.
Terminal
$ export CV_API_KEY=cv_sk_…

Set your key once. Every cv command reads it.

Usage
cv targets <file>cv targets --from <format>

Read the list

Each line names a target and what the conversion keeps and drops. A target that joins several files into one says joins many files.

Only the conversions this list shows exist. cv convert to any other target fails with unsupported_conversion, and its try: line lists the targets.

Terminal
$ cv targets photo.heic
stdoutheic ->8 lines
heic ->  pdf      The main picture on one page at its own size, or fitted on A4 or Letter with page_size, stored as a JPEG at quality 90.  txt      The picture is turned upright first. The text read by OCR as plain lines, in English unless language lists others (en, ko, ja, zh, zh-TW). Layout, tables and pictures are dropped, and a picture with no readable text fails with unsupported_elements.  png      The main picture at the same size without further loss, with its EXIF kept, so the file is several times larger. Depth maps, HDR gain maps and any other pictures in the file are dropped.  jpeg     The main picture at the same size and quality 90 unless asked otherwise, with its EXIF kept. Transparency becomes white unless background gives another color. Depth maps, HDR gain maps and any other pictures in the file are dropped.  webp     The main picture at the same size, lossy at quality 90 unless lossless is set, with its EXIF kept. Depth maps, HDR gain maps and any other pictures in the file are dropped.  tiff     Same pixels and transparency, compressed without loss.  dcm      The main picture at the same size as an uncompressed DICOM secondary capture image at 8 bits per channel; depth maps, HDR gain maps, EXIF and the color profile are dropped. Patient and study fields are left empty, and new study, series and image IDs are made up.

With --json

Each target has to, inputs (one, or many for a join), version, note, and options, a JSON Schema of the options it takes with their ranges and defaults. A target that takes edits has edits, and one that can be read with refs has refs.

Terminal
$ cv targets photo.heic --json
stdout{34 lines
{  "data": {    "from": "heic",    "object": "targets",    "targets": [      …,      {        "from": "heic",        "id": "heic>jpeg",        "inputs": "one",        "note": "The main picture at the same size and quality 90 unless asked otherwise, …",        "options": {          "additionalProperties": false,          "properties": {            "quality": {              "default": 90,              "description": "Lossy compression quality",              "maximum": 100,              "minimum": 1,              "type": "integer"            },            …          },          "type": "object"        },        "outputs": "one",        "to": "jpeg",        "version": "96098536"      },      …    ]  },  "ok": true}