imagedimensions(
imagedimensions(
IMAGEFILE
)

The imagedimensions( function returns the dimensions (height and width) of an image file.

Parameters

This function has one parameter:

imagefile – Path and filename of image file.

Description

This function returns the dimensions (height and width) of an image file. The dimensions are returned as a point, so you can extract the individual dimensions with the v( and h( functions.

    local imageSize
    imageSize = imagedimensions("~/Desktop/Image.png")
    if v(imageSize)=h(imageSize)
        message "The image is square!"
    endif

If the specified image doesn’t exist, or if the file isn’t an image, the height and width will both be zero.

    local imageSize
    imageSize = imagedimensions("~/Desktop/Image.png")
    if imageSize=point(0,0)
        message "Image does not exist!"
    endif

See Also

- clipboardimagesave -- saves an image on the clipboard as an image file (.jpg, .png, etc.).
- clipboardimagesize( -- returns the dimensions of whatever image is currently on the computer's clipboard.
- imageinfo( -- returns information about an image file on disk.

History

Version | Status | Notes
10.0 | New | New in this version.