/** * Generates JPG type image and returns its location on file system * * @param string $sSource image source * @param string $sTarget image target * @param int $iWidth image width * @param int $iHeight image height * @param int $iQuality new image quality * * @return string */ protected function _generateJpg($sSource, $sTarget, $iWidth, $iHeight, $iQuality) { return resizeJpeg($sSource, $sTarget, $iWidth, $iHeight, @getimagesize($sSource), getGdVersion(), null, $iQuality); }
/** * type dependant image resizing * * @param array $aImageInfo Contains information on image's type / width / height * @param string $sSrc source image * @param string $hDestinationImage Destination Image * @param string $sTarget Resized Image target * @param int $iNewWidth Resized Image's width * @param int $iNewHeight Resized Image's height * @param mixed $iGdVer used GDVersion, if null or false returns false * @param bool $blDisableTouch false if "touch()" should be called for gif resizing * @param string $iDefQuality quality for "imagejpeg" function * * @return bool */ protected function _resize($aImageInfo, $sSrc, $hDestinationImage, $sTarget, $iNewWidth, $iNewHeight, $iGdVer, $blDisableTouch, $iDefQuality) { startProfile("PICTURE_RESIZE"); $blSuccess = false; switch ($aImageInfo[2]) { //Image type case $this->_aImageTypes["GIF"]: //php does not process gifs until 7th July 2004 (see lzh licensing) if (function_exists("imagegif")) { $blSuccess = resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo[0], $aImageInfo[1], $iGdVer); } break; case $this->_aImageTypes["JPEG"]: case $this->_aImageTypes["JPG"]: $blSuccess = resizeJpeg($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage, $iDefQuality); break; case $this->_aImageTypes["PNG"]: $blSuccess = resizePng($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage); break; } if ($blSuccess && !$blDisableTouch) { @touch($sTarget); } stopProfile("PICTURE_RESIZE"); return $blSuccess; }
/** * Generates JPG type image and returns its location on file system * * @param string $source image source * @param string $target image target * @param int $width image width * @param int $height image height * @param int $quality new image quality * * @return string */ protected function _generateJpg($source, $target, $width, $height, $quality) { return resizeJpeg($source, $target, $width, $height, @getimagesize($source), getGdVersion(), null, $quality); }