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:
apairon committed 2026-10-27 18:04:55 +00:00
1 parent f26f8c7802
commit 913d5f4cb6
6 files changed
+263 -4

No files matched your search

+63
View File
@@ -13,6 +13,69 @@
},
"path": {
"type": "string"
},
"imageProcessing": {
"type": "object",
"additionalProperties": false,
"properties": {
"access": {
"type": "string",
"enum": [
"public"
]
},
"cachePath": {
"type": "string"
},
"allowOriginal": {
"type": "boolean"
},
"defaultFilter": {
"type": "string"
},
"allowedInputTypes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"image/jpeg",
"image/png",
"image/webp"
]
}
},
"limits": {
"type": "object",
"additionalProperties": false,
"properties": {
"maxInputBytes": {
"type": "integer",
"minimum": 1,
"maximum": 67108864
},
"maxPixels": {
"type": "integer",
"minimum": 1,
"maximum": 40000000
}
}
},
"imageFilter": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "image-filter.schema.json"
}
]
}
},
"required": [
"access",
"cachePath",
"imageFilter"
]
}
},
"required": [
+91 -1
View File
@@ -33,7 +33,7 @@
"catmullRom",
"lanczos",
"box",
"mitchellNetravili",
"mitchellNetravali",
"bSpline",
"gaussian",
"bartlett",
@@ -102,6 +102,96 @@
"png",
"webp"
]
},
"removeBackground": {
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
},
"tolerance": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"fromEdges": {
"type": "boolean"
},
"edgeBlur": {
"type": "number",
"minimum": 0,
"maximum": 1000
},
"referenceWidth": {
"type": "integer",
"minimum": 0,
"maximum": 100000
}
}
},
"dropShadow": {
"type": "object",
"additionalProperties": false,
"properties": {
"color": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
},
"opacity": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"blur": {
"type": "number",
"minimum": 0,
"maximum": 1000
},
"offsetX": {
"type": "number",
"minimum": -1000,
"maximum": 1000
},
"offsetY": {
"type": "number",
"minimum": -1000,
"maximum": 1000
},
"padding": {
"type": "number",
"minimum": 0,
"maximum": 10000
},
"referenceWidth": {
"type": "integer",
"minimum": 0,
"maximum": 100000
},
"canvas": {
"type": "string",
"enum": [
"expand",
"fixed"
]
},
"background": {
"oneOf": [
{
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
},
{
"const": "transparent"
}
]
}
}
},
"flatten": {
"type": "string",
"pattern": "^#[0-9a-fA-F]{6}$"
}
}
}