/* Check for a supported multi-page image */
if ($image->isMultiPage() === true) {
- $params['name'] = $image->getPageCount() . ' page image: ' . $image->filename;
+ $params['name'] = $image->getImagePageCount() . ' page image: ' . $image->filename;
$mGallery = $GLOBALS['ansel_storage']->createGallery($params, $this->getPermission(), $this->getId());
$i = 1;
foreach ($image as $page) {
* @return integer The number of pages.
* @throws Ansel_Exception
*/
- public function getPageCount()
+ public function getImagePageCount()
{
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
+
try {
return $this->_image->getImagePageCount();
} catch (Horde_Image_Exception $e) {
*/
public function rewind()
{
- $this->load();
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
try {
$this->_image->rewind();
} catch (Horde_Image_Exception $e) {
*/
public function current()
{
- $this->load();
- return $this->_buildImageObject($this->_image->current());
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
+ try {
+ return $this->_buildImageObject($this->_image->current());
+ } catch (Horde_Image_Exception $e) {
+ throw new Ansel_Exception($e);
+ }
}
/**
*/
public function key()
{
- $this->load();
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
try {
return $this->_image->key();
} catch (Horde_Image_Exception $e) {
*/
public function next()
{
- $this->load();
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
if ($next = $this->_image->next()) {
return $this->_buildImageObject($next);
}
*/
public function valid()
{
- $this->load();
+ if (empty($this->_loaded['full'])) {
+ $this->load();
+ }
try {
return $this->_image->valid();
} catch (Horde_Image_Exception $e) {