$left = $this->_getPage($fluidbook_id, $page);\r
$right = $this->_getPage($fluidbook_id, $page + 1);\r
\r
- $ratio = $left['width'] / $left['height'];\r
+ // Sometimes a page might not return a valid size (eg. Page 0 with no graphic)\r
+ // If the left page doesn't work, use the right page\r
+ $width = ($left['width'] == -1) ? $right['width'] : $left['width'];\r
+ $height = ($left['height'] == -1) ? $right['height'] : $left['height'];\r
+\r
+ $ratio = $width / $height;\r
\r
$backgrounds = array();\r
// $backgrounds[] = array('image' => '/images/exemples/publications/shadow.png', 'size' => '100% 10%', 'position' => '0 95%', 'blendmode' => null);\r
\r
$res .= '}';\r
$res .= '</style>';\r
- $res .= $this->htmlElement($this->htmlElement('', 'div', array('class' => 'shadow')), 'div', array('class' => 'exemple-fluidbook', 'id' => $cssid, 'data-width' => $left['width'] * 2, 'data-height' => $left['height']));\r
+ $res .= $this->htmlElement($this->htmlElement('', 'div', array('class' => 'shadow')), 'div', array(\r
+ 'class' => 'exemple-fluidbook',\r
+ 'id' => $cssid,\r
+ 'data-width' => $width * 2,\r
+ 'data-height' => $height));\r
return $res;\r
}\r
\r