Module: nagvis Branch: master Commit: d18c079bd0f44f4891eb2fc483a9bafd45747c43 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=d18c079bd0f44f4891eb2fc483a9bafd45747c43
Author: Lars Michelsen <[email protected]> Date: Mon Jun 7 19:42:11 2010 +0200 Skipping the automap thumbnail generation silently if the automap image does not exists --- share/server/core/classes/GlobalIndexPage.php | 28 +++++++++++++----------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/share/server/core/classes/GlobalIndexPage.php b/share/server/core/classes/GlobalIndexPage.php index 645bba5..606a5d2 100644 --- a/share/server/core/classes/GlobalIndexPage.php +++ b/share/server/core/classes/GlobalIndexPage.php @@ -150,20 +150,22 @@ class GlobalIndexPage { $MAP->renderMap(); // If the message still does not exist print an error and skip the thumbnail generation - if($this->checkImageExists($imgPath, FALSE) && $this->CORE->checkGd(0)) { - $sThumbFile = $mapName.'-thumb.'.$this->getFileType($imgPath); - $sThumbPath = $this->CORE->getMainCfg()->getValue('paths','sharedvar').$sThumbFile; - $sThumbPathHtml = $this->CORE->getMainCfg()->getValue('paths','htmlsharedvar').$sThumbFile; - - // Only create a new thumb when there is no cached one - $FCACHE = new GlobalFileCache($this->CORE, $imgPath, $sThumbPath); - if($FCACHE->isCached() === -1) { - $image = $this->createThumbnail($imgPath, $sThumbPath); + if($this->checkImageExists($imgPath, FALSE)) { + if($this->CORE->checkGd(0)) { + $sThumbFile = $mapName.'-thumb.'.$this->getFileType($imgPath); + $sThumbPath = $this->CORE->getMainCfg()->getValue('paths','sharedvar').$sThumbFile; + $sThumbPathHtml = $this->CORE->getMainCfg()->getValue('paths','htmlsharedvar').$sThumbFile; + + // Only create a new thumb when there is no cached one + $FCACHE = new GlobalFileCache($this->CORE, $imgPath, $sThumbPath); + if($FCACHE->isCached() === -1) { + $image = $this->createThumbnail($imgPath, $sThumbPath); + } + + $map['overview_image'] = $sThumbPathHtml; + } else { + $map['overview_image'] = $imgPathHtml; } - - $map['overview_image'] = $sThumbPathHtml; - } else { - $map['overview_image'] = $imgPathHtml; } } ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
