Skip to content

v2.3.0

Choose a tag to compare

@github-actions github-actions released this 27 Jan 16:40
· 63 commits to master since this release

2.3.0 (2026-01-27)

Features

  • Allow customization of file-preview through annotation and support image preview (#1081) (df8e7f9)

    Image preview

    The file preview now supports images. We're using HTML's img tag to display images, so all the types that this tag supports (.png, .jpeg, .jpg, .gif, .bmp, .svg, .ico, .avif, .apng) are supported by default (assuming the file size is within the allowed threshold).

    Annotation

    We added a few more properties to the file_preview property of the tag:isrd.isi.edu,2017:asset annotation:

    • prefetch_max_file_size: Change the threshold for allowing file preview.
    • prefetch_bytes: Change how many bytes we should fetch when the file is larger than the allowed max size and the file/server supports range requests.
    • default_height: Set the default height of the preview container.
    • content_type_mapping: Modify the default content-type mapping or support other content types.
    • filename_ext_mapping: Modify the default filename extension mapping or support other content types.
    • disabled: Disable any preview type that you don't want. For example, if you don't like the markdown and image preview, you could add "disabled": ["markdown", "image"].

    With the recent change to column-defaults, you can define these properties for the whole catalog, schema, or table instead of defining them per column:

    {
      "tag:isrd.isi.edu,2023:column-defaults": {
        "asset": {
          "url": {
            "tag:isrd.isi.edu,2017:asset": {
              "display": {
                "*": {
                  "file_preview": {
                    "prefetch_max_file_size": {
                      "image": 500000
                    },
                    "content_type_mapping": {
                      "image/": false,
                      "image/png": "image"
                    },
                    "filename_ext_mapping": {
                      ".mycsv": "csv"
                    },
                    "disabled": ["markdown"]
                  }
                }
              }
            }
          }
        }
      }
    }