Esempio n. 1
0
         }
     } else {
         $debug->add("Skipping {$dimm}.");
     }
 }
 // WAP PREVIEWS
 $debug->add("Formatting {$targetDir}/" . $g->filename . ".gif");
 foreach ($game_dimensions_wap_preview as $dimm => $dactive) {
     if ($dactive == "1") {
         // FORMATOS - GIF,JPEG,PNG,BMP
         $debug->add("Formatting {$targetDir}/" . $g->filename . ".gif");
         foreach ($game_wappreview_formats as $format => $factive) {
             if ($factive == "1") {
                 list($width, $height) = explode("x", $dimm);
                 $debug->add("Creating {$format} {$width}" . "x{$height}");
                 if (copy_format_img($g->filename, $width, $height, "", ".gif", ".{$format}", "#FFFFFF") === FALSE) {
                     $debug->add("ERROR creating {$format} {$width}" . "x{$height}");
                 } else {
                     $debug->add("Success!!!");
                     $g->add("wappreview", "<file_{$dimm}>" . $g->filename . "_{$dimm}.{$format}</file_{$dimm}>\n");
                 }
             } else {
                 $debug->add("Skipping processing {$format}, {$dimm}");
             }
         }
     } else {
         $debug->add("Skipping {$dimm}.");
     }
 }
 $debug->add("Switching to Local FTP - 241");
 $USE_LOCAL_FTP = TRUE;
Esempio n. 2
0
 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;
 }