]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 2 Feb 2011 19:28:07 +0000 (19:28 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 2 Feb 2011 19:28:07 +0000 (19:28 +0000)
.htaccess
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/Metier/class.ws.document.php
swf/_src/WSComposer.as3proj

index 183878b3d3165522a8948d9b73553e58c6577697..690dc17c8685c21fa798a9c40aa80f2f442a308c 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -27,6 +27,6 @@ RewriteRule ^telecharger/([0-9]+)/(.*)$ index.php/telecharger/$1/$2 [L]
 RewriteRule ^([-_a-zA-Z0-9/]+)$ index.php/$1 [L]\r
 \r
 RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.html$ viewer/$1_$2_$3/index [L]\r
-RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/_unprotected/index.swf [L]\r
-RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/_unprotected/player.swf [L]\r
+RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/index.swf$ fluidbook/compile/index.swf [L]\r
+RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/player.swf$ fluidbook/compile/player.swf [L]\r
 RewriteRule ^viewer/([0-9]+)_([0-9a-fA-F]+)_([0-9]+)/(.+)$ fluidbook/books/final/$1/$4 [L]\r
index 74def33fde3b1619c9cdb699e3547d65e5d3daac..612dd0a6c4b2eed2c005cce0c7696e023ef98e41 100644 (file)
@@ -597,6 +597,7 @@ class wsFlash extends cubeFlashGateway {
        public function compile()\r
        {\r
                global $core;\r
+               wsSecureSWF::checkProtectedSWF();\r
                $dao = new wsDAOBook($core->con);\r
                if (!$dao->isUpToDate($this->args['book_id'])) {\r
                        $dao->compile($this->args['book_id'], 3);\r
index 4db180fa31cff2d00a90d04709d6f0de7161d400..5bd8b8ab77b7fb44244a92ec4419171750d6524a 100644 (file)
@@ -93,7 +93,7 @@ class wsUrl {
                                $res .= '<td>' . $core->books_status[$book->status] . '</td>';\r
                        }\r
                        $res .= '<td class="bouton"><a class="popupFS" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
-                       $res .= '<td class="bouton"><a class="popupFS" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
+                       $res .= '<td class="bouton"><a class="popupFS" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '">' . $btStats . '</a></td>';\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'supprimebook/' . $book->book_id . '">' . $btDownload . '</a></td>';\r
                        if ($droits->creation) {\r
@@ -280,7 +280,7 @@ html{height:100%}' . "\n";
                $book_id = $e[0];\r
 \r
                self::checkDocumentVersionOfBook($book_id);\r
-               //wsSecureSWF::checkProtectedSWF();\r
+               wsSecureSWF::checkProtectedSWF();\r
 \r
                $book = $dao->selectById($book_id);\r
                if ($book->hash != $e[1]) {\r
index 3e3fb255661ad8c7e9f9f1f5d274bd89b1222228..5c5a3a1d41e4b157face41328537ca3eaf3e6ff2 100644 (file)
@@ -45,7 +45,7 @@ class wsDocument extends cubeMetier {
        const BARBARE_PNM = 4;\r
        const BARBARE_GS = 5;\r
 \r
-       const PNM_FILL = 6;\r
+       const PNM_FILL = 2;\r
 \r
        protected static $resolution2multiply = array(72 => 2, 100 => 2, 150 => 3, 200 => 3, 300 => 3, 450 => 4, 600 => 5);\r
        // Number section styles\r
@@ -369,7 +369,7 @@ class wsDocument extends cubeMetier {
                $this->makeShot($page, 'te', 150, 60, 4, 'GS', $this->uncropped);\r
        }\r
 \r
-       public function makeShotFixedWidth($page , $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'GS')\r
+       public function makeShotFixedWidth($page , $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'PNM')\r
        {\r
                // Make thumbs of $w width\r
                // resolution 72 make 1pt=1px\r
@@ -378,7 +378,7 @@ class wsDocument extends cubeMetier {
                $this->makeShot($page, $prefix, round(72 / $ratio, 2), $quality, $antialiasing, $method);\r
        }\r
 \r
-       public function makeShotFixedHeight($page , $prefix = '', $h = '', $quality = 90, $antialiasing = 4, $method = 'GS')\r
+       public function makeShotFixedHeight($page , $prefix = '', $h = '', $quality = 90, $antialiasing = 4, $method = 'PNM')\r
        {\r
                // Make thumbs of $w height\r
                // resolution 72 make 1pt=1px\r
@@ -387,20 +387,25 @@ class wsDocument extends cubeMetier {
                $this->makeShot($page, $prefix, round(72 / $ratio, 2), $quality, $antialiasing, $method);\r
        }\r
 \r
-       public function makeShot($page , $prefix = '', $resolution = 72, $quality = 90, $antialiasing = 4, $method = 'GS', $in = null)\r
+       public function makeShot($page , $prefix = '', $resolution = 72, $quality = 90, $antialiasing = 4, $method = 'PNM', $in = null)\r
        {\r
                $error = false;\r
                if (is_null($in)) {\r
                        $in = $this->cropped;\r
                }\r
                // Delete all old files\r
+               $res = $this->out . $prefix . $page . '.jpg';\r
+               if (file_exists($res)) {\r
+                       @unlink($res);\r
+               }\r
+\r
                if ($method == 'GS') {\r
                        $this->makeShotGS($page, $prefix, $resolution, $quality, $antialiasing, $in);\r
                } elseif ($method == 'PNM') {\r
                        $this->makeShotPNM($page, $prefix, $resolution, $quality, $antialiasing, $in);\r
                }\r
                // Test the result by checking all files\r
-               if (!file_exists($this->out . $prefix . $page . '.jpg')) {\r
+               if (!file_exists($res)) {\r
                        $error = true;\r
                }\r
                // If error, we try to make thumbs with other method\r
@@ -467,6 +472,7 @@ class wsDocument extends cubeMetier {
 \r
                $pdftoppm->setArg('-cropbox');\r
                $pdftoppm->setArg('-freetype yes');\r
+               $pdftoppm->setArg('-jpeg');\r
                $pdftoppm->setArg('-aa ' . $antialiasing);\r
                $pdftoppm->setArg('-aaVector ' . $antialiasing);\r
                $pdftoppm->setArg('r', $resolution);\r
@@ -475,23 +481,13 @@ class wsDocument extends cubeMetier {
                $pdftoppm->execute();\r
                $this->addToLog($pdftoppm, true, $page);\r
 \r
-               $startpage = is_null($page)?1:$page;\r
+               $ppmfile = $this->out . 'ppm-' . cubeMath::fill($page, self::PNM_FILL) . '.ppm';\r
+               $ppmjpgfile = $this->out . 'ppm-' . cubeMath::fill($page, self::PNM_FILL) . '.jpg';\r
+               $jpegfile = $this->out . $prefix . $page . '.jpg';\r
 \r
-               for($i = $startpage;true;$i++) {\r
-                       $ppmfile = $this->out . 'ppm-' . cubeMath::fill($i, PNM_FILL) . '.ppm';\r
-                       $jpegfile = $this->out . $prefix . $i . '.jpg';\r
-                       if (!file_exists($ppmfile)) {\r
-                               break;\r
-                       }\r
-                       $pnmtojpeg = new cubeCommandLine('pnmtojpeg', $jpegfile, false);\r
-                       $pnmtojpeg->setPath(CONVERTER_PATH);\r
-                       $pnmtojpeg->setArg('-quality=' . $quality);\r
-                       $pnmtojpeg->setArg('-density=' . $resolution . 'x' . $resolution . 'dpi');\r
-                       $pnmtojpeg->setManualArg($ppmfile);\r
-                       $pnmtojpeg->execute();\r
-\r
-                       $this->addToLog($pnmtojpeg, false, $i);\r
-                       unlink($ppmfile);\r
+               if (file_exists($ppmjpgfile)) {\r
+                       rename($ppmjpgfile, $jpegfile);\r
+                       $this->addToLog('Move ' . $ppmjpgfile . ' to ' . $jpegfile, true, $page);\r
                }\r
        }\r
 \r
index 0b4dcd43f37b573fef204bee8706459f4e2c6e69..990f80d1628f801a5264142191f907de793703a4 100644 (file)
@@ -5,7 +5,7 @@
     <movie disabled="False" />\r
     <movie input="" />\r
     <movie path="..\composer.swf" />\r
-    <movie fps="60" />\r
+    <movie fps="45" />\r
     <movie width="1024" />\r
     <movie height="768" />\r
     <movie version="10" />\r