core.bones.image

Classes

ImageBoneRelSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a

ImageBone

A FileBone is a custom bone class that inherits from the TreeLeafBone class, and is used to store and manage

Module Contents

class core.bones.image.ImageBoneRelSkel

Bases: core.skeleton.relskel.RelSkel

This is a Skeleton-like class that acts as a container for Skeletons used as a additional information data skeleton for RelationalBone.

It needs to be sub-classed where information about the kindName and its attributes (bones) are specified.

The Skeleton stores its bones in an OrderedDict-Instance, so the definition order of the contained bones remains constant.

alt
class core.bones.image.ImageBone(*, public=True, using=ImageBoneRelSkel, validMimeTypes=['image/*'], **kwargs)

Bases: core.bones.file.FileBone

A FileBone is a custom bone class that inherits from the TreeLeafBone class, and is used to store and manage file references in a ViUR application.

Parameters:
  • format – Hint for the UI how to display a file entry (defaults to it’s filename)

  • maxFileSize – The maximum filesize accepted by this bone in bytes. None means no limit. This will always be checked against the original file uploaded - not any of it’s derivatives.

  • derive

    A set of functions used to derive other files from the referenced ones. Used fe. to create thumbnails / images for srcmaps from hires uploads. If set, must be a dictionary from string (a key from conf.file_derivations) to the parameters passed to that function. The parameters can be any type (including None) that can be json-serialized.

    # Example
    derive = { "thumbnail": [{"width": 111}, {"width": 555, "height": 666}]}
    

  • validMimeTypes (None | Iterable[str]) –

    A list of Mimetypes that can be selected in this bone (or None for any) Wildcards (“image/*”) are supported.

    # Example
    validMimeTypes=["application/pdf", "image/*"]
    

  • public (bool)

  • using (Optional[core.skeleton.relskel.RelSkel])

Initializes a new Filebone. All properties inherited by RelationalBone are supported.

Parameters:
  • format – Hint for the UI how to display a file entry (defaults to it’s filename)

  • maxFileSize – The maximum filesize accepted by this bone in bytes. None means no limit.

  • public (bool)

  • using (Optional[core.skeleton.relskel.RelSkel])

  • validMimeTypes (None | Iterable[str])

This will always be checked against the original file uploaded - not any of it’s derivatives. :param derive: A set of functions used to derive other files from the referenced ones. Used to create thumbnails and images for srcmaps from hires uploads. If set, must be a dictionary from string (a key from) conf.file_derivations) to the parameters passed to that function. The parameters can be any type (including None) that can be json-serialized.

# Example
derive = {"thumbnail": [{"width": 111}, {"width": 555, "height": 666}]}
Parameters:
  • validMimeTypes (None | Iterable[str]) –

    A list of Mimetypes that can be selected in this bone (or None for any). Wildcards (‘image*’) are supported.

    #Example
    validMimeTypes=["application/pdf", "image/*"]
    

  • public (bool)

  • using (Optional[core.skeleton.relskel.RelSkel])

type = 'relational.tree.leaf.file.image'

The type of this bone is ‘relational.tree.leaf.file’.