Getting a sprite's dimensions

Hi,
I’m trying to get the dimensions of a Sprite for a project I’m creating. I have tried sprite.width and sprite.height, and that didn’t work. Anyone know how to get them?

function setup()
    img=readImage("Planet Cute:Character Horn Girl")
    print(img.width)
    print(img.height)
end

@niorg2606 you can also do this:

function setup()
     local width,height=spriteSize("Planet Cute:Character Horn Girl")
     print(width)
     print(height)
end

Except, I would recommend what @dave1707 did because it’s much more versatile.

As @CamelCoder pointed out, there’s usually more than one way to do something. You’ll find that out as you write more code. A lot of it comes down to your coding style.