ageurtse
12-26-2009, 12:56 PM
I would like to know how to get an attachments height and width. how could i do this.
for displaying the image i use
$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1>";
i put this in a cel from a table. but i would scale the longest size to fit in this cell so it attachment would display normal and not stretcht out.
i think i use
if ($height < $width){$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1 width=100%>";}
else
{$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1 height=100%>";};
but how do i get this width and height
for displaying the image i use
$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1>";
i put this in a cel from a table. but i would scale the longest size to fit in this cell so it attachment would display normal and not stretcht out.
i think i use
if ($height < $width){$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1 width=100%>";}
else
{$output .= "<img border=0 src=attachment.php?attachmentid=".$post['attachmentid']."&thumb=1 height=100%>";};
but how do i get this width and height