Image width

Is it possible to get the image width of the currently shown image? I'm trying to get the width with the help from the php-function "getimagesize" and all I get is this warning (I removed the serverpath):
`getimagesize(/*serverpath*/zen/i.php?a=stover-rennen&i=crossbow.JPG&s=450): failed to open stream: No such file or directory in /*serverpath*/themes/newtheme/image.php on line 29`
I think that the function needs a direct link to the cached image and not to the i.php, because the path informations are correct.

Anyone an idea?

Comments

  • trisweb Administrator
    I've found myself needing this, so I think I'll write some methods in the image class to take care of it.

    You can't call getimagesize on that url because it's not actually an image from the server path. PHP has to 'run' it first. You might try the webpath instead, which should work, but is pretty slow and innefficient. I'll make some native functions to do it instead.

    You could also use "getSizedImage()" and call it on that URL (with the webpath, not the server path) if you want the sizes of the default-sized images.

    FYI, I'll be adding the ability for a theme to set the desired thumbnail size, standard image size, thumbnail size and characteristics, and default number of images/albums per page.
Sign In or Register to comment.