sips-js-api
    Preparing search index...

    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 extends keyof ImageProperties>(name: T): ImageProperties[T];
        scaledSizeWithLongestEdge(longestEdge: number): Size;
        setProperty<T extends keyof ImageProperties>(
            name: T,
            value: ImageProperties[T],
        ): void;
        sizeToFitLongestEdge(longestEdge: number): Size;
    }
    Index
    aspectRatio: number

    Aspect ratio of image.

    name: string

    Name of image.

    properties: Readonly<ImageProperties>

    Image properties.

    size: Size

    Size of image (pixels).

    • 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.
    • 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.