Forum Moderators: coopster

Message Too Old, No Replies

Unexpected t-variable

         

nfs2

10:36 am on Apr 13, 2006 (gmt 0)

10+ Year Member



function makeThumbnail($o_file, $t_ht = 100) {
   $image_info = getImageSize($o_file); //unexpected variable on this line
  
   switch ($image_info['mime']) {
       case 'image/gif':
           if (imagetypes() & IMG_GIF)  { // not the same as IMAGETYPE
               $o_im = imageCreateFromGIF($o_file) ;
           } else {
               $ermsg = 'GIF images are not supported<br />';
           }
//and so on...

I simply dont get why that causes an error.. Anyonehave any idea?

HoagieKat

11:11 am on Apr 13, 2006 (gmt 0)

10+ Year Member



is IMG_GIF defined? IMG_GIF would have to be defined as a constant otherwise it'd be $IMG_GIF.

Scratch that... I've looked it up:

[bugs.php.net...]

Try this.

And your PHP build has to have GIF support built into it.

nfs2

11:44 am on Apr 13, 2006 (gmt 0)

10+ Year Member



I tried and thats not it, i commented where the error happens, its before that

jatar_k

4:09 pm on Apr 13, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



start from the line you showed and start moving up, something is mismatched or forgotten on some line before causing it to trickle down to there

nfs2

9:15 pm on Apr 13, 2006 (gmt 0)

10+ Year Member



Functions.php;

<?php
function makeThumbnail($o_file, $t_ht = 100) {
$image_info = getImageSize($o_file); //unexpected variable on this line

Maybe it's just a glitch with the server?

jatar_k

9:56 pm on Apr 13, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what's the full error?

nfs2

3:41 am on Apr 14, 2006 (gmt 0)

10+ Year Member



Parse error: syntax error, unexpected T_VARIABLE in /home/me/public_html/functions on line 3

jatar_k

4:14 am on Apr 14, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what about trying something as simple as changing the function case

getImageSize to getimagesize

it should actually be all lower case

nfs2

4:26 am on Apr 14, 2006 (gmt 0)

10+ Year Member



yea i tried that already, i tired everything i could think of..

I mean is it possible that the php version on my server ahs anything to do with it? Its 4.4.2

JohnCanyon

8:18 pm on Apr 14, 2006 (gmt 0)

10+ Year Member



*edit* not a problem. J

jatar_k

3:01 pm on Apr 15, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the version shouldn't be the difference and the only thing that looks funnny in there is the function case

do you have an auto prepend or something?

the error is coming from somewhere you just need to figure out where

you could also try putting quotes around the default value in your function declaration.

Little_G

3:09 pm on Apr 15, 2006 (gmt 0)

10+ Year Member



Hi,

Have you tried defining '$image_info' globally?
And, have you checked to make sure you are sending all required arguments to the function and that they are of the correct type?

Andrew