The getimagesize() function... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

The getimagesize() function...

NeakNeak Posts: 87Member
[code]
while($arrayage = mysql_fetch_array($neak_results))
{
$imagesize = getimagesize($arrayage[path]);
$tempwidth = $imagesize[0];
$tempheight = $imagesize[1];
if($tempwidth > 550)
{
$tempwidth = 550;
}
if($tempheight > 750)
{
$tempheight = 750;
}
# Post info.
echo '['. $arrayage[title] .']&nbsp&nbsp';
echo '
';
}

[/code]
That's a while loop for my gallery script. It's the loops that goes through each row of the database and echoes the thumbnail of that row.

I am positive that the $arrayage[path] is the path of the image in every row of the database, and yet, it print nothing (not 0, but nothing) to the places where it would print the things that it gets from getimagesize()... Does anyone know why?

Comments

  • netgertnetgert Posts: 331Member
    I had a quick look at your code and can't find anything suspicious. Try printing values after each line where the value might change (like after getimagesize, $tempwidth = $imagesize[0] etc). Debugging in this way you can narrow down to the line where things get weird. :-D

    : [code]
    : while($arrayage = mysql_fetch_array($neak_results))
    : {
    : $imagesize = getimagesize($arrayage[path]);
    : $tempwidth = $imagesize[0];
    : $tempheight = $imagesize[1];
    : if($tempwidth > 550)
    : {
    : $tempwidth = 550;
    : }
    : if($tempheight > 750)
    : {
    : $tempheight = 750;
    : }
    : # Post info.
    : echo '['. $arrayage[title] .']&nbsp&nbsp';
    : echo '';
    : }
    :
    : [/code]
    : That's a while loop for my gallery script. It's the loops that goes through each row of the database and echoes the thumbnail of that row.
    :
    : I am positive that the $arrayage[path] is the path of the image in every row of the database, and yet, it print nothing (not 0, but nothing) to the places where it would print the things that it gets from getimagesize()... Does anyone know why?
    :

    [hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]

  • NeakNeak Posts: 87Member
    : I had a quick look at your code and can't find anything suspicious. Try printing values after each line where the value might change (like after getimagesize, $tempwidth = $imagesize[0] etc). Debugging in this way you can narrow down to the line where things get weird. :-D

    It turns out that it was the image type that I had uploaded that was giving me the problem. If I remember right, the one I tested was one that I just saved from a web page.
  • DarQDarQ Posts: 1,625Member
    [b][red]This message was edited by Moderator at 2003-12-28 7:5:26[/red][/b][hr]
    : I had a quick look at your code and can't find anything suspicious. Try printing values after each line where the value might change (like after getimagesize, $tempwidth = $imagesize[0] etc). Debugging in this way you can narrow down to the line where things get weird. :-D

    [red]
    perfect way of debugging. "will i see, what i expect to see" ;-) 10 points for you :-D
    [/red]
    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com



  • netgertnetgert Posts: 331Member
    : [b][red]This message was edited by Moderator at 2003-12-28 7:5:26[/red][/b][hr]
    : : I had a quick look at your code and can't find anything suspicious. Try printing values after each line where the value might change (like after getimagesize, $tempwidth = $imagesize[0] etc). Debugging in this way you can narrow down to the line where things get weird. :-D
    :
    : [red]
    : perfect way of debugging. "will i see, what i expect to see" ;-) 10 points for you :-D
    : [/red]
    just wondering... what points?
    : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : url--> http://mark.space.servehttp.com
    :
    :
    :
    :

    [hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]

  • DarQDarQ Posts: 1,625Member
    : : [b][red]This message was edited by Moderator at 2003-12-28 7:5:26[/red][/b][hr]
    : : : I had a quick look at your code and can't find anything suspicious. Try printing values after each line where the value might change (like after getimagesize, $tempwidth = $imagesize[0] etc). Debugging in this way you can narrow down to the line where things get weird. :-D
    : :
    : : [red]
    : : perfect way of debugging. "will i see, what i expect to see" ;-) 10 points for you :-D
    : : [/red]
    : just wondering... what points?

    [red]
    10/10, eehm, it's a very good remark he made... that's about it.
    [/red] : [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    : : url--> http://mark.space.servehttp.com
    : :
    : :
    : :
    : :
    :
    : [hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

Sign In or Register to comment.