changeset 266:3e4eaae2f7df

add support for just giving the attachment name, fix typo
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 14 Sep 2008 00:15:21 +0200
parents 37b96db69d0e
children de2f265a9ac5
files data/plugin/macro/Image.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/Image.py	Sat Sep 13 23:56:05 2008 +0200
+++ b/data/plugin/macro/Image.py	Sun Sep 14 00:15:21 2008 +0200
@@ -225,11 +225,13 @@
 
         We use a very high default value for width and height, because PIL will calculate the
         image dimensions to not be larger than (width, height) and also not be larger than
-        the original image. Thus, by not giving widht or height, you'll get the original image,
+        the original image. Thus, by not giving width or height, you'll get the original image,
         and if you specify width or height you will get an image of that width or that height.
 
         <<Image(PageName/attachname,width=100,alt="sample image")>>
     """
+    if '/' not in itemname:
+        itemname = macro.formatter.page.page_name + '/' + itemname
     img = Image(macro.request, itemname, alt)
     return macro.formatter.image(src=img.url((width, height)), alt=img.description)