{
  "openapi": "3.0.3",
  "info": {
    "title": "图片水印裁剪缩略接口",
    "description": "图片水印裁剪缩略api是一个全功能的图像处理服务，能够快速生成缩略图、裁剪图片以及添加水印，满足您的多样化图像处理需求。简单易用的接口设计，让您轻松实现专业级的图像处理效果。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1-8": {
      "x-pointCode": 8,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "生成缩略图-URL",
        "description": "生成缩略图服务能够根据您传入的比率要求，将原始图片智能地缩减到指定的大小，从而快速创建出缩略图版本。广泛应用于网页设计、图像分享和数据库管理中。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "生成的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0表示调用成功"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_8_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "string",
                    "description": "裁剪后的宽度"
                  },
                  "height": {
                    "type": "string",
                    "description": "裁剪后的高度"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  },
                  "src_img_url": {
                    "type": "string",
                    "description": "图片URL，最大不要超过5M"
                  },
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  }
                },
                "required": [
                  "src_img_url",
                  "type"
                ]
              }
            }
          }
        }
      }
    },
    "/1-5": {
      "x-pointCode": 5,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "生成缩略图-base64",
        "description": "生成缩略图服务能够根据您传入的比率要求，将原始图片智能地缩减到指定的大小，从而快速创建出缩略图版本。广泛应用于网页设计、图像分享和数据库管理中。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "生成的图片地址"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_5_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  },
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 10500000,
                    "description": "图片文件的base64格式字符串。"
                  },
                  "height": {
                    "type": "string",
                    "description": "缩略图高度，单位px，正整数"
                  },
                  "width": {
                    "type": "string",
                    "description": "缩略图宽度，单位px,，正整数"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。br/是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  }
                },
                "required": [
                  "type",
                  "src_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "图像裁剪-base64",
        "description": "提供了一种方便快捷的方式来裁剪原始图像的特定区域。通过这一服务，您可以轻松地从原始图片中提取出您感兴趣的部分，以便于更好地展示或应用于不同的场合。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "裁剪后的图片地址"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "string",
                    "description": "裁剪后的宽度"
                  },
                  "height": {
                    "type": "string",
                    "description": "裁剪后的高度"
                  },
                  "x": {
                    "type": "string",
                    "description": "从x轴哪个座标点开始"
                  },
                  "y": {
                    "type": "string",
                    "description": "从y轴哪个座标点开始"
                  },
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 10000000,
                    "description": "原图的base64格式字符串。"
                  }
                },
                "required": [
                  "width",
                  "height",
                  "src_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 10,
      "post": {
        "summary": "添加图片水印-base64",
        "description": "传入底板图及水印图，根据位置参数，接口把水印图添加到底板图上。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "合成后的图片地址"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000000,
                    "description": "底板图的base64格式字符串。"
                  },
                  "logo_img_base64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000000,
                    "description": "水印图的base64格式字符串。"
                  },
                  "position": {
                    "type": "string",
                    "description": "水印在底图的位置。可以为这些参数：NorthWest North NorthEast West Center East SouthWest South SouthEast/默认值在右下角。"
                  },
                  "xy": {
                    "type": "string",
                    "description": "比如+5+10表示水印的下边缘距原始图片10像素、右边缘距原始图片5像素"
                  }
                },
                "required": [
                  "src_img_base64",
                  "logo_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "添加图片水印",
        "description": "传入底板图及水印图，根据位置参数，接口把水印图添加到底板图上。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "合成后的图片地址"
                            },
                            "ret_code": {
                              "type": "string",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "src_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "底图文件"
                  },
                  "logo_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "logo图文件"
                  },
                  "position": {
                    "type": "string",
                    "description": "水印在底图的位置。可以为这些参数：NorthWest North NorthEast West Center East SouthWest South SouthEast/默认值在右下角。"
                  },
                  "xy": {
                    "type": "string",
                    "description": "比如+5+10表示水印的下边缘距原始图片10像素、右边缘距原始图片5像素"
                  }
                },
                "required": [
                  "src_img",
                  "logo_img"
                ]
              }
            }
          }
        }
      }
    },
    "/1-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 5,
      "post": {
        "summary": "生成缩略图",
        "description": "我们的生成缩略图服务为您提供了一种高效便捷的方式，可以将原始图片按照您设定的比例转化为缩略图。这一服务特别适用于需要预览或节省存储空间的场景，例如社交媒体分享、网页设计、图片库管理等。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "生成的图片地址"
                            },
                            "ret_code": {
                              "type": "string",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  },
                  "src_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "以文件形式（ multipart/form-data）上传的表单字段"
                  },
                  "height": {
                    "type": "string",
                    "description": "缩略图高度，单位px，正整数"
                  },
                  "width": {
                    "type": "string",
                    "description": "缩略图宽度，单位px,，正整数"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。br/是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  }
                },
                "required": [
                  "type",
                  "src_img"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/1?tab=book"
  },
  "x-apiCode": "1",
  "x-is-own": false,
  "x-is-op": true
}