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


History

VersionStatusNotes
10.0NewNew in this version.