Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End ImgBrowz0r thumbnail generation Re: ImgBrowz0r thumbnail generation

#80073
dcp3450
Participant

I should note. to use this concept:

//get the percentage difference
sizeDifference = (newHeight *100)/currentHeight; //(245*100)/600 = 40.83333..
//get the new width based on the percentage
newWidth = (currentWidth*sizeDifference)/100;//(400*40.83333…)/100=163.3333…
//set your sizes
currentHeight = newHeight;
currentWidth = ciel(newWidth);//using ciel() will remove the decimal and round accordingly

echo it as such:
echo ‘<img src="/images/image.png" height="’.$currentHeight.’" width="’.$currentWidth.’" alt="">’;