Schema: Bildoperationen (removeBackground/dropShadow/flatten) und Asset-Bildmodus
- image-filter.schema.json: removeBackground (color/tolerance/fromEdges/edgeBlur/ referenceWidth), dropShadow (color/opacity/blur/offsets/padding/referenceWidth/ canvas/background), flatten; Tippfehler mitchellNetravili -> mitchellNetravali - asset.schema.json: optionaler imageProcessing-Block (access/cachePath/ allowOriginal/defaultFilter/allowedInputTypes/limits/imageFilter) - index.d.ts: passende Interfaces inkl. AssetConfig - Beispiel: examples/server/asset-image-processing.yml, demo-api imageFilter.shadow - validate-schemas.mjs: examples/server-Pattern je Schema
This commit is contained in:
1 parent
f26f8c7802
commit
913d5f4cb6
6 files changed
+263
-4
No files matched your search
Vendored
+49
-2
@@ -343,6 +343,26 @@ declare global {
|
||||
export type PreviewConfig = string | EvalHtmlConfig | PreviewSlots
|
||||
|
||||
/** Image filter parameters — used in both CollectionConfig.imageFilter and ImagePackage.filter() */
|
||||
export interface RemoveBackgroundParams {
|
||||
color?: string
|
||||
tolerance?: number
|
||||
fromEdges?: boolean
|
||||
edgeBlur?: number
|
||||
referenceWidth?: number
|
||||
}
|
||||
|
||||
export interface DropShadowParams {
|
||||
color?: string
|
||||
opacity?: number
|
||||
blur?: number
|
||||
offsetX?: number
|
||||
offsetY?: number
|
||||
padding?: number
|
||||
referenceWidth?: number
|
||||
canvas?: "expand" | "fixed"
|
||||
background?: string
|
||||
}
|
||||
|
||||
export interface ImageFilterParams {
|
||||
width?: number
|
||||
height?: number
|
||||
@@ -355,7 +375,7 @@ declare global {
|
||||
| "catmullRom"
|
||||
| "lanczos"
|
||||
| "box"
|
||||
| "mitchellNetravili"
|
||||
| "mitchellNetravali"
|
||||
| "bSpline"
|
||||
| "gaussian"
|
||||
| "bartlett"
|
||||
@@ -387,6 +407,33 @@ declare global {
|
||||
skipLargerDimension?: boolean
|
||||
skipLargerFilesize?: boolean
|
||||
outputType?: "jpg" | "jpeg" | "png" | "webp"
|
||||
removeBackground?: RemoveBackgroundParams
|
||||
dropShadow?: DropShadowParams
|
||||
flatten?: string
|
||||
}
|
||||
|
||||
/** Limits for asset image processing (`imageProcessing.limits`) */
|
||||
export interface AssetImageLimitsConfig {
|
||||
maxInputBytes?: number
|
||||
maxPixels?: number
|
||||
}
|
||||
|
||||
/** Asset image processing block (`imageProcessing`) */
|
||||
export interface AssetImageProcessingConfig {
|
||||
access: "public"
|
||||
cachePath: string
|
||||
allowOriginal?: boolean
|
||||
defaultFilter?: string
|
||||
allowedInputTypes?: Array<"image/jpeg" | "image/png" | "image/webp">
|
||||
limits?: AssetImageLimitsConfig
|
||||
imageFilter: { [name: string]: ImageFilterParams[] } | string
|
||||
}
|
||||
|
||||
/** Asset config entry */
|
||||
export interface AssetConfig {
|
||||
name: string
|
||||
path: string
|
||||
imageProcessing?: AssetImageProcessingConfig
|
||||
}
|
||||
|
||||
/** Collection config as returned by context.collection() – JSON-serialized from Go CollectionConfig */
|
||||
@@ -573,7 +620,7 @@ declare global {
|
||||
lastReload: string
|
||||
namespace: string
|
||||
meta?: { [key: string]: any }
|
||||
assets?: { name: string; path: string }[]
|
||||
assets?: AssetConfig[]
|
||||
collections?: CollectionInfo[]
|
||||
actions?: ActionInfo[]
|
||||
jobs?: JobConfig[]
|
||||
|
||||
Reference in new issue
Block a user