Class $k.Blob

The value of a blob attribute.

Class Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Class Detail

$k.Blob()

Method Detail

  • {string} base64String()
    Returns the blob bytes as base 64 encoded string
    Returns:
    {string}
  • {$k.NetEntity} convertImage(mediaType)
    Converts the image to another media type
    Parameters:
    {string} mediaType
    The media type of the converted image
    Throws:
    {$k.exception.InvalidValue}
    If the image could not be converted
    Returns:
    {$k.NetEntity} The converted image
  • {$k.NetEntity} createThumbnail(width, height, mediaType)
    Create a thumbnail with the specified maxium dimensions. The aspect ratio is preserved. Width or height can be undefined, but not both. The media type is optional and specifies the image type of the thumbnail. If not defined, the thumbnail will have the same type as the original image.
    Parameters:
    {number} width
    The maximum width of the thumbnail
    {number} height
    The maximum height of the thumbnail
    {string} mediaType Optional
    The media type of the converted image
    Throws:
    {$k.exception.InvalidValue}
    If the image could not be converted
    Returns:
    {$k.NetEntity} The converted image
  • {string} dataUrl()
    Returns the blob bytes as a data URL
    Returns:
    {string}
    See:
    http://dataurl.net/#about
  • {boolean} equals(value)
    Returns true if the values are equal
    Parameters:
    value
    Returns:
    {boolean}
  • {string} fileExtension()
    Returns the extension of the filename of the blob, without dot
    Returns:
    {string}
  • {string} filename()
    Returns the filename of the blob
    Returns:
    {string}
  • {string} language()
    Returns the language of the blob, or undefined if not translated
    Returns:
    {string}
  • {string} locator()
    Returns a string that identifies the blob. Can be used to get the blob contents from the blob REST service
    Returns:
    {string}
  • {string} mimeType()
    Returns the mime type of the blob
    Returns:
    {string}
  • {number} size()
    Returns the byte size of the blob
    Returns:
    {number}
  • {string} text(charset)
    Returns the blob bytes as string
    Parameters:
    {string} charset
    Charset of the characters. UTF-8 if undefined
    Returns:
    {string}
  • {$k.NetEntity} toNetEntity()
    Creates a NetEntity from this blob
    Returns:
    {$k.NetEntity}