X-Git-Url: http://positon.org/gitweb/?p=bizou.git;a=blobdiff_plain;f=plugins%2F_disabled%2Fbalanced%2Ffunctions.php;fp=plugins%2F_disabled%2Fbalanced%2Ffunctions.php;h=9464423b557fb0d8de597594773bc7d85e656974;hp=0000000000000000000000000000000000000000;hb=c4491b6746923f941bea358f6bbbe9d40368a0f8;hpb=983aec6f252b587aaf4118a5c416bc919d84669e diff --git a/plugins/_disabled/balanced/functions.php b/plugins/_disabled/balanced/functions.php new file mode 100644 index 0000000..9464423 --- /dev/null +++ b/plugins/_disabled/balanced/functions.php @@ -0,0 +1,64 @@ + $h) { + // $newW = $maxSize; + // $newH = $h/($w/$maxSize); + //} else { + $newW = $w/($h/$maxSize); + $newH = $maxSize; + //} + + $newImg = imagecreatetruecolor($newW, $newH); + + imagecopyresampled($newImg, $img, 0, 0, 0, 0, $newW, $newH, $w, $h); + + if ($ext == ".jpg") + imagejpeg($newImg, $newImgFile); + else + imagepng($newImg, $newImgFile); + + imagedestroy($img); + imagedestroy($newImg); + } + + return $newImgFile; +} + + +?>