Skip to content

Commit

Permalink
Add Data URL information to Image layer
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wils committed Mar 8, 2024
1 parent 48bdd67 commit 60d6dec
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/specs/values.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ but most players ignore the last component.
{schema_object:values/bezier}

{editor_example:bezier}

<h2 id="data-url">Data URL</h2>

Data URLs are embedded files (such as images) as defined in RFC2397.
15 changes: 14 additions & 1 deletion schema/assets/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,22 @@
"type": "number"
},
"p": {
"title": "File Name",
"description": "Name of the image file or a data url",
"oneOf": [
{"type": "string"},
{"$ref": "#/$defs/values/data-url"}
]
},
"u": {
"title": "File Path",
"description": "Path to the image file",
"type": "number"
"type": "string"
},
"e": {
"title": "Embedded",
"description": "If '1', 'p' is a Data URL",
"$ref": "#/$defs/values/int-boolean"
}
},
"required": ["w", "h", "p"]
Expand Down
7 changes: 7 additions & 0 deletions schema/values/data-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"title": "Data URL",
"description": "An embedded data object",
"pattern": "^data:([\\w/]+)(;base64)?,(.+)$"
}

0 comments on commit 60d6dec

Please sign in to comment.