webCOMAND

#IMAGE GetWidth

Get the width, as an integer value, of the image represented by the image bytes.

Prototype

#IMAGE($image_bytes, GetWidth)

Return

The width of the image represented by the image bytes, as an integer number of pixels.

Example

#/ get the file extension based on the image format
#NEW($format)#IMAGE($img,GetFormat)#ENDNEW
#IF($format)
    #NEW($w)#IMAGE($img,GetWidth)#ENDNEW
    #NEW($h)#IMAGE($img,GetHeight)#ENDNEW
    #NEW($ext)#IMAGE($img,GetExtension)#ENDNEW
    <img src="#OUTPUT('photo-${w}x${h}.$ext',$img)" />
#ELSE
    #WARNING('Unrecognized Format')
#ENDIF

Related

#IMAGE GetHeight