当前位置: 首页>>代码示例>>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;未经允许,请勿转载。