{
  "name": "image-metadata",
  "summary": "Reads an image's EXIF/ICC/IPTC/XMP metadata and can return a copy with all metadata stripped.",
  "rationale": "Reading and stripping image metadata safely needs a real decoder and a hardened fetch: an agent that pulls the URL itself walks past every SSRF control, and a strip must be byte-reproducible, which an ad-hoc re-encode is not.",
  "family": "images",
  "price_usd": "0.003",
  "free": false,
  "timeout_ms": 30000,
  "max_timeout_seconds": 51,
  "input_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "maxLength": 2048,
        "format": "uri",
        "description": "Absolute http(s) URL of the image to inspect, up to 2048 characters; redirects are followed and the format is detected from the bytes."
      },
      "strip": {
        "default": false,
        "description": "When true, also return a same-format copy re-encoded with every metadata block removed (lossy sources at quality 80); allowed for JPEG, PNG, WebP, TIFF and GIF.",
        "type": "boolean"
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/images/metadata-exif.jpg",
    "strip": true
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/images/metadata-exif.jpg",
    "format": "jpeg",
    "width": 32,
    "height": 24,
    "channels": 3,
    "space": "srgb",
    "depth": "uchar",
    "has_alpha": false,
    "has_profile": true,
    "orientation": 6,
    "density": 72,
    "is_progressive": false,
    "metadata": {
      "exif_bytes": 186,
      "icc_bytes": 480,
      "iptc_bytes": null,
      "xmp_bytes": null
    },
    "bytes": 1024,
    "stripped": {
      "format": "jpeg",
      "bytes": 333,
      "image_base64": "/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsj..."
    }
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}