Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

getimagesize

edited July 2008 in Vanilla 1.0 Help
Hi All, I'm new to vanilla, new to php, and new to HTML forms (but not new to computers). I am building an AddIn - it's pretty trivial and is really a learning exercise for me, but I will post it for comments when I have it working as I want. I make lots of mistakes along the way - some easier to solve than others but I have reached a dead end with this. I don't think it's actually a vanilla problem - it may be php, or it may, perhaps, be my web server. There may be another way to do what I want - and I'd be happy to hear it - but I'd still like to know why my way isn't working. Anyway, I wanted to show a thumbnail of an image, but keep it in proportion, so I set the height and tried to calculate the width. If it matters the code is in a settings form. The form itself is in an included member inside the Render function of a class that extends PostBackControl - in a separate member that is included in my Addin default.php. First of all I just used ordinary variables and, then tried, class level variables (assuming my syntax is correct) but it made no difference. Relevant code is: $this -> ImageStore = $this -> Context -> Configuration ['BASE_URL'] .'extensions/' .basename ( dirname (__FILE__) ) .'/' .'images/'; $this -> CurrentImage = $this -> ImageStore . 'sharplogo.gif'; $this -> ImageDisplayHeight = 32; // list($this -> ImageWidth, $this -> ImageHeight) = getimagesize( $this -> CurrentImage); // $this -> CurrentImageWidth = round( $this -> ImageDisplayHeight / $this -> ImageHeight * $this -> ImageWidth ); (and then a little later, as part of an echo statement that otherwise works, correctly as far as I can tell) .'<img src = "'.$this -> CurrentImage.'" height = '.$this -> ImageDisplayHeight.'px width = '.$this -> CurrentImageWidth.'px />' What happens when I uncomment the two commented lines is that the page hangs when I try to refresh it. Once in a while I have thought that it has worked (but it may well be that I had something different on those occasions). What am I doing wrong? I will try and keep an eye here for any response but am away (and mostly not on line) for the weekend. Thanks in advance for any help anyone can offer. Tony Jollans.
This discussion has been closed.