@zack/resize-image
Resize an image from a URL. Returns base64 JPEG.
Install
agentpm install @zack/resize-image@0.1.7Load
import { load } from '@agentpm/sdk';
const t = await load('@zack/resize-image@0.1.7');from agentpm import load
t = load("@zack/resize-image@0.1.7")Weekly downloads
3
0%
Last publish
3w ago
v0.1.7
agent.json
{
"name": "resize-image",
"version": "0.1.7",
"description": "Resize an image from a URL. Returns base64 JPEG.",
"files": [
"dist/"
],
"entrypoint": {
"args": [
"dist/index.cjs"
],
"command": "node",
"timeout_ms": 30000
},
"inputs": {
"type": "object",
"required": [
"url",
"width",
"height"
],
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "URL of the image to fetch and resize"
},
"width": {
"type": "integer",
"minimum": 1,
"description": "The desired width of the new image"
},
"height": {
"type": "integer",
"minimum": 1,
"description": "The desired height of the new image"
},
"keep_aspect": {
"type": "boolean",
"default": true,
"description": "Whether to keep aspect while fitting within width x height (true), or to resize to the exact size as requested by the width and height inputs, no aspect preservation (false)"
}
},
"additionalProperties": false
},
"outputs": {
"oneOf": [
{
"type": "object",
"required": [
"ok",
"image_base64_jpeg"
],
"properties": {
"ok": {
"const": true
},
"image_base64_jpeg": {
"type": "string",
"description": "The base64 encoded jpeg",
"contentEncoding": "base64",
"contentMediaType": "image/jpeg"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"ok",
"error"
],
"properties": {
"ok": {
"const": false
},
"error": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"type": "string",
"description": "Stable machine-readable error code (e.g. INPUT_INVALID, FETCH_FAILED)"
},
"details": {
"type": "object",
"description": "Optional structured context"
},
"message": {
"type": "string",
"description": "Human-readable error message"
}
},
"additionalProperties": true
}
},
"additionalProperties": false
}
]
},
"readme": "README.md",
"license": {
"file": "LICENSE",
"spdx": "MIT"
},
"runtime": {
"type": "node",
"version": "20"
}
}Compatibility
NodePython