}
protected function _rsync($src, $dest, $erase = false, $chown = null) {
- if (!is_null($chown)) {
-
- }
if (is_file($src)) {
$dir = dirname($dest);
if (!file_exists($dir)) {
$cp = new cubeCommandLine('rsync');
$cp->setPath(CONVERTER_PATH);
- if ($erase) {
- $cp->setArg('del');
- }
+
$cp->setArg('t');
$cp->setArg('r');
- $cp->setArg('z');
$cp->setArg('v');
- $cp->setArg(null, $src . '*');
- $cp->setArg(null, $dest);
+ if ($erase) {
+ $cp->setArg('force');
+ $cp->setArg('delete-after');
+ }
+ $cp->setArg(null, rtrim($src, '/') . '/');
+ $cp->setArg(null, rtrim($dest, '/') . '/');
$cp->execute();
+ fb($cp->commande);
+ fb($cp->output);
+
if (!is_null($chown)) {
`chown -R $chown $dest`;
}
unlink($vdir . '/widget.html');
unlink($vdir . '/cache.appcache');
- $this->makeScreenshots();
-
if ($this->makeResources) {
+ $this->makeScreenshots();
if ($os == 'ios') {
$this->makeIOSResources($vdir . '/Resources');
} elseif ($os == 'android') {
}
protected function makeScreenshots() {
- $resolutions = array('ipad' => '1024x768', 'iphone3-5' => '960x640', 'iphone-4' => '1136x640');
+ $resolutions = array('ipad' => array('width' => 1024, 'height' => 768, 'zoom' => 2), 'iphone3-5' => array('width' => 960, 'height' => 640, 'zoom' => 1), 'iphone-4' => array('width' => 1136, 'height' => 640, 'zoom' => 1));
$views = array();
- $s=str_replace("\r","\n", $this->book->parametres->appScreenshots);
- $screenshots=explode("\n",$s);
+ $s = str_replace("\r", "\n", $this->book->parametres->appScreenshots);
+ $screenshots = explode("\n", $s);
foreach ($screenshots as $v) {
$v = trim($v);
$views[] = array('orientation' => $orientation, 'url' => $url);
}
- $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html#';
+ $baseUrl = 'http://workshop.fluidbook.com/viewerh/' . $this->book->book_id . '_' . $this->book->hash . '_' . $this->book->compilehtml5date . '/index.html?s=1#';
foreach ($resolutions as $n => $res) {
+ $z = isset($res['zoom']) ? $res['zoom'] : 1;
+ $w = $res['width'] * $z;
+ $h = $res['height'] * $z;
- list($w, $h) = explode('x', $res);
$dir = $this->vdir . '/screenshots/' . $n . '/';
- if(!file_exists($dir)){
- mkdir($dir,0777,true);
+ if (!file_exists($dir)) {
+ mkdir($dir, 0777, true);
}
foreach ($views as $k => $view) {
$cl = new cubeCommandLine('xvfb-run');
$cl->setArg('server-args', '-screen 0, ' . $screenWidth . 'x' . $screenHeight . 'x24');
- $cl->setArg(null, 'cutycapt');
- $cl->setArg('min-width',$screenWidth);
- $cl->setArg('min-height',$screenHeight);
- $cl->setArg('user-styles','http://workshop.fluidbook.com/style/ws/html5-screenshot.css');
+ $cl->setArg(null, 'CutyCapt');
+ $cl->setArg('min-width', $screenWidth);
+ $cl->setArg('min-height', $screenHeight);
+ $cl->setArg('zoom-factor', $z);
$cl->setArg('url', $url);
$cl->setArg('delay', '1000');
$cl->setArg('out', $out);
'drawable-xhdpi' => 96
);
-
$splashs = array('drawable' => '1024x768',
'drawable-hdpi' => '1024x768',
'drawable-ldpi' => '320x480',
foreach ($splashs as $size => $name) {
list($width, $height) = explode('x', $size);
- $this->_makeSplash($width, $height, $name, $resources . '/icons');
+ $this->_makeSplash($width, $height, $name, $resources . '/splash');
}
foreach ($icons as $size => $name) {
$this->_makeIcon($size, $name, $resources . '/icons', 'ios');