當前位置: 首頁>>代碼示例>>PHP>>正文


PHP convert::saveIMG方法代碼示例

本文整理匯總了PHP中convert::saveIMG方法的典型用法代碼示例。如果您正苦於以下問題:PHP convert::saveIMG方法的具體用法?PHP convert::saveIMG怎麽用?PHP convert::saveIMG使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在convert的用法示例。


在下文中一共展示了convert::saveIMG方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generatePreview

 private function generatePreview()
 {
     $ftpCon = new Ftp(FTP_USA, FTP_USA_USR, FTP_USA_PWD);
     $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     if (!$connected) {
         return false;
     }
     $from = str_replace("%RESOLUTION%", PREVIEW_WIDTH . "x" . PREVIEW_HEIGHT, $this->getPreview());
     $from = str_replace("contenido", "netuy", $from);
     $from = "/www.wazzup.com.uy/" . $from;
     $previewFilename = "preview" . str_replace(" ", "_", sanitizeString($this->title)) . ".gif";
     $tmp = $this->dirToWrite . "/" . $previewFilename;
     echo "preview {$from} => {$tmp}";
     $bajado = $ftpCon->bajar_r($from, $tmp, FTP_DOWN_RETRIES);
     $targetDir = $this->dirToWrite;
     $prev_sin_ext = str_replace(".gif", "", $previewFilename);
     $ret = copy_format_img($prev_sin_ext, $targetDir, 80, 80, "", ".gif", ".gif");
     echo '<li>Retorno de la copia del preview: ' . print_r($ret, true);
     $ret = copy_format_img($prev_sin_ext, $targetDir, 40, 40, "", ".gif", ".gif");
     echo '<li>Retorno de la copia del preview: ' . print_r($ret, true);
     //Borro el preview original, porque no se sube
     $shellCmd = "cd " . $this->dirToWrite . "; rm -f {$previewFilename}";
     exec($shellCmd);
     $this->previewFilenames[] = $prev_sin_ext . "_80x80.gif";
     $this->previewFilenames[] = $prev_sin_ext . "_40x40.gif";
     $carpeta = $this->calcularCarpeta($this->contentId);
     $pathScreenshots = "/previews/java/240x320/" . $carpeta . "/";
     $this->screenshotsFilenames[] = $this->contentId . "_1.jpg";
     $this->screenshotsFilenames[] = $this->contentId . "_2.jpg";
     $this->screenshotsFilenames[] = $this->contentId . "_3.jpg";
     $ftpCon = new Ftp(FTP_241, FTP_241_USR, FTP_241_PWD);
     $connected = $ftpCon->login_r(null, null, FTP_CONN_RETRIES);
     foreach ($this->screenshotsFilenames as $fn) {
         $tmp = $this->dirToWrite . "/" . $fn;
         $from = $pathScreenshots . "" . $fn;
         echo '<li>Bajando screenshot: ' . $from . ' => ' . $tmp . '</li>';
         $bajado = $ftpCon->bajar_r($from, $tmp, FTP_DOWN_RETRIES);
         //echo '<li>Resultado del FTP: ' . print_r($bajado, true).'</li>';
         $cnvrt = new convert($tmp, "jpg", 240, 320);
         echo '<li>Convirtiendo screenshot para que pese menos....</li>';
         $cnvrt->saveIMG($tmp);
     }
     return $bajado;
 }
開發者ID:vallejos,項目名稱:samples,代碼行數:44,代碼來源:personalGame.class.php


注:本文中的convert::saveIMG方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。