Interface Image

The Image interface represents an image that is passed to sips as argument. It can be obtained through Configuration.images.

interface Image {
    aspectRatio: number;
    name: string;
    properties: Readonly<ImageProperties>;
    size: Size;
    getProperty<T>(name): ImageProperties[T];
    scaledSizeWithLongestEdge(longestEdge): Size;
    setProperty<T>(name, value): void;
    sizeToFitLongestEdge(longestEdge): Size;
}

Properties

aspectRatio: number

Aspect ratio of image.

name: string

Name of image.

properties: Readonly<ImageProperties>

Image properties.

size: Size

Size of image (pixels).

Methods

  • Return the image property for name, if any.

    Type Parameters

    Parameters

    • name: T

      Name of the image property.

    Returns ImageProperties[T]

    • Value of the property associated with name.
  • Return the rectangle size whose longer side equals to the specified length. Maintains aspect ratio.

    Parameters

    • longestEdge: number

      Pixel size of the longest edge.

    Returns Size

    • Calculated size that fits the square whose size has the specified length.
  • Set the image property for name to value.

    Type Parameters

    Parameters

    • name: T

      Name of the image property.

    • value: ImageProperties[T]

      Value of the property associated with name.

    Returns void

  • Return the size that will contain the image with the longest edge set to length. Maintains aspect ratio.

    Parameters

    • longestEdge: number

      Pisel size of the longest edge.

    Returns Size

    • Calculated size that fits the square whose size has the specified length.

Generated using TypeDoc