Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Allows to test some file variables to decide to execute command set.

parameters

  • filter: the selector

    • a string
      considered as the extension of the file to match with (equals), or the mimetype to match with (equals or starts with)

    • a string array, as a list of file extensions or mimetypes to match with

    • a json object, as an conditional expression (logical and combination)

      • property as a variable

        • extension: extension of current file

        • mimetype: mimetype of current file

        • name: name of current file

        • basename: name (without extension) of current file

        • path: relative to san path of the current file

        • length: length of current file (bytes)

        • lastmodified: last modified timestamp (unix epoch time) of current file

        • width: pixel width of current file

        • height: pixel height of current file

        • xdpi: horizontal density in dots per inch of current file

        • ydpi: vertical density in dots per inch of current file

        • original.extension: extension of original file

        • original.mimetype: mimetype of original file

        • original.name: name of original file

        • original.basename: name (without extension) of original file

        • original.path: relative to san path of the original file

        • original.length: length of original file (bytes)

        • original.lastmodified: last modified timestamp (unix epoch time)

        • original.width: pixel width of original file

        • original.height: pixel height of original file

        • original.xdpi: horizontal density in dots per inch of original file

        • original.ydpi: vertical density in dots per inch of original file

          Value is the test to be performed, as

          • a simple value, to check if the variable is equal to
            Example:

            "filter": {
                "extension":"jpg"
            }
          • an object, as logical and combination, where property name is an operator and value is the value to used with the operator, or an array of values (logical or combination)

          • an array, as logical or combination of all items
            Example 1:

            {
               "filter": {
                   "extension":["jpg","png"]
               }
            }

            Example 2:

            {
               "filter": {
                   "mimetype":["application/pdf",{"startswith":"image/"}]
               }
            }


      • property as a logical operator

        • or: the value must be an array of conditions

          example:

          {
             "filter": {
                "or": [
                        {"path": {"ct":"/asset/"}},
                        {"path": {"ct":"/legacy/"}}
                    ]
                ]
             }
          }
        • and: The value must be an array of conditions.

          example:

          {
             "filter": {
                "and": [
                        {"extension":"jpg"},
                        {"length":{"<":"2MiB"}}
                    ]
                ]
             }
          }
        • not: the value must be an object (conditional expression)

          example:

          {
             "filter": {
                "not": {
                    "extension": ["zip","mp4"]          ]
                }
             }
          }


    • an array, as a combination table of the above types
      Example:

      {
         "filter": [
             {
                 "extension":"jpg"
             },
             {
                 "extension":"png",
                 "length":{"<":"2MiB"}
             }
         ]
      }

  • if: action to do if file matches selector

  • else: action to do if file doen’t match selector

Action can be:

  • null: means cancel transform execution (do not return any image)

  • json object or json array: a command set to apply

  • empty json object or empty json array: continue process

JSON object properties

simplified syntax parameters

array type parameters

string type parameter

  • No labels