{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Cover image for a book in the authenticated user's personal library. Serves the cover extracted from the uploaded file when there is one; otherwise, if the book is linked to a BookHive catalog entry, responds 302 to the public image proxy for that entry. The XRPC equivalent of GET /opds/books/{hash}/cover.",
      "errors": [
        {
          "description": "No such book, or the book has neither a stored cover nor a linked catalog entry",
          "name": "NotFound"
        }
      ],
      "output": {
        "encoding": "image/jpeg,image/png,image/gif,image/webp"
      },
      "parameters": {
        "properties": {
          "contentHash": {
            "description": "Content hash identifying the book",
            "type": "string"
          },
          "width": {
            "default": 300,
            "description": "Requested width in pixels for the catalog-cover redirect. Ignored for locally stored covers, which are served at the size they were extracted at.",
            "maximum": 1024,
            "minimum": 32,
            "type": "integer"
          }
        },
        "required": [
          "contentHash"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "buzz.bookhive.getPersonalBookCover",
  "lexicon": 1
}
