1
Site/Forum Features / Re: new forum feature coded - ability to inline link attachments!
« on: June 21, 2007, 04:49 AM »
Hi Mouser,
once again: Is there a way to set a max width for fullsizeInlineImages so they will not crash my layout.
The following function should solve my problem, but I really don't know how to edit my files
function resizeImage($width, $height, $maxWidth, $maxHeight)
{
$srcRatio=$width / $height; // width/height ratio
$destRatio=$maxWidth / $maxHeight;
if ($destRatio > $srcRatio)
{
$destSize[1]=$maxHeight;
$destSize[0]=ceil($maxHeight * $srcRatio);
}
else
{
$destSize[0]=$maxWidth;
$destSize[1]=ceil($maxWidth / $srcRatio);
}
return $destSize;
}
Thanks for some instructions
Greetz from Germany
Timo
once again: Is there a way to set a max width for fullsizeInlineImages so they will not crash my layout.
The following function should solve my problem, but I really don't know how to edit my files
function resizeImage($width, $height, $maxWidth, $maxHeight)
{
$srcRatio=$width / $height; // width/height ratio
$destRatio=$maxWidth / $maxHeight;
if ($destRatio > $srcRatio)
{
$destSize[1]=$maxHeight;
$destSize[0]=ceil($maxHeight * $srcRatio);
}
else
{
$destSize[0]=$maxWidth;
$destSize[1]=ceil($maxWidth / $srcRatio);
}
return $destSize;
}
Thanks for some instructions
Greetz from Germany
Timo