changeset 575:0db77eb786fb

text_x_arnica: Bug Fix: ignore not existing images in get_image_alias
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 07 Mar 2012 13:33:52 +0100
parents 7520756bc7f9
children a4d66592dea7
files data/plugin/parser/text_x_arnica.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/text_x_arnica.py	Mon Feb 06 21:56:45 2012 +0100
+++ b/data/plugin/parser/text_x_arnica.py	Wed Mar 07 13:33:52 2012 +0100
@@ -331,9 +331,10 @@
             if line.startswith('[[') and line.endswith(']]') and '|' in line:
                 img, alias = line[2:-2].split('|', 1)
                 # don't count an image more than once and verify that it is an image
-                if wikiutil.isPicture(img.strip()) and img.strip() not in image_alias.keys():
+                if  AttachFile.exists(self.request, self.pagename, img.strip()) and wikiutil.isPicture(img.strip()) and img.strip() not in image_alias.keys():
                     image_alias[img.strip()] = (self.formatter.text(alias.strip()), counter, img)
                     counter += 1
+                # ToDo add a placeholder image for not existing images but already defined 
         return image_alias
 
     def select_files(self, formatter, target_page):