Download src/media/image-processor-config.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 933 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/media/image-processor-config.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/media/image-processor-config.ts
-
curl -L -o image-processor-config.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/media/image-processor-config.ts
933 Bytes
| import { createRastermill, type ImageExecutionMode } from "rastermill"; | |
| import { resolveSystemBin } from "../infra/resolve-system-bin.js"; | |
| import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; | |
| /** Shared input/output pixel cap for Rastermill-backed image operations. */ | |
| export const MAX_IMAGE_INPUT_PIXELS = 25_000_000; | |
| export type ImageProcessorPixelLimits = { inputPixels: number; outputPixels: number }; | |
| export function createLocalImageProcessor( | |
| execution: ImageExecutionMode, | |
| limits: ImageProcessorPixelLimits = { | |
| inputPixels: MAX_IMAGE_INPUT_PIXELS, | |
| outputPixels: MAX_IMAGE_INPUT_PIXELS, | |
| }, | |
| ) { | |
| return createRastermill({ | |
| execution, | |
| limits, | |
| temp: { | |
| rootDir: resolvePreferredOpenClawTmpDir(), | |
| prefix: "openclaw-img-", | |
| }, | |
| commandResolver: (command) => | |
| resolveSystemBin(command, { trust: command === "powershell" ? "strict" : "standard" }), | |
| }); | |
| } | |