Skip to content

wiered issue #1166

Closed
Closed

Description

@wanghaisheng

schema like this

                        templateschema = {
                                        "$schema": "http://json-schema.org/draft-04/schema#",
                                        "type": "object",
                                        "properties": {
                                            "canvasWidth": {
                                            "type": "integer"
                                            },
                                            "canvasHeight": {
                                            "type": "integer"
                                            },
                                            "texts": {
                                            "type": "array",
                                            "items": [
                                                {
                                                "type": "object",
                                                "properties": {
                                                    "textType": {
                                                    "type": "string"
                                                    },
                                                    "fontFile": {
                                                    "type": "string"
                                                    },
                                                    "x": {
                                                    "type": "integer"
                                                    },
                                                    "y": {
                                                    "type": "integer"
                                                    },
                                                    "width": {
                                                    "type": "integer"
                                                    },
                                                    "height": {
                                                    "type": "integer"
                                                    },
                                                    "topLeft": {
                                                    "type": "string"
                                                    },
                                                    "topRight": {
                                                    "type": "string"
                                                    },
                                                    "bottomLeft": {
                                                    "type": "string"
                                                    },
                                                    "bottomRight": {
                                                    "type": "string"
                                                    },
                                                    "fontSize": {
                                                    "type": "integer"
                                                    },
                                                    "fontName": {
                                                    "type": "string"
                                                    },
                                                    "gridSize": {
                                                    "type": "integer"
                                                    },
                                                    "nearestGridSerialNumber": {
                                                    "type": "integer"
                                                    },
                                                    "fontcolor": {
                                                    "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "textType",
                                                    "fontFile",
                                                    "x",
                                                    "y",
                                                    "width",
                                                    "height",
                                                    "topLeft",
                                                    "topRight",
                                                    "bottomLeft",
                                                    "bottomRight",
                                                    "fontSize",
                                                    "fontName",
                                                    "gridSize",
                                                    "nearestGridSerialNumber",
                                                    "fontcolor"
                                                ]
                                                }
                                            ]
                                            }
                                        },
                                        "required": [
                                            "canvasWidth",
                                            "canvasHeight",
                                            "texts"
                                        ]
                                        }

instance is

{'canvasWidth': 1480, 'canvasHeight': 1080, 'texts': [{'textType': 'heading', 'fontFile': '', 'x': 349, 'y': 452, 'width': 788, 'height': 88, 'topLeft': '(349, 452)', 'topRight': '(1137, 452)', 'bottomLeft': '(349, 540)', 
'bottomRight': '(1137, 540)', 'fontSize': 22, 'fontName': 'Unknown', 'gridSize': 10, 'nearestGridSerialNumber': 43, 'fontcolor': 'rgb(0, 240, 255)'}]}
                    except Exception as e:
                        logger.error(f'this thumb template json dont follow json schema format,check the error msg:\n{e}')
                        print(e)

throw me a
'width'

Activity

  1. locked and limited conversation to collaborators on Sep 20, 2023
  2. converted this issue into a discussion #1167 on Sep 20, 2023
  3. added
    Invalid
    on Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Invalid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions