Index: src/App/config.py
===================================================================
--- src/App/config.py	(revisão 114644)
+++ src/App/config.py	(cópia de trabalho)
@@ -36,7 +36,7 @@
 def setConfiguration(cfg):
     """Set the global configuration object.
 
-    Legacy sources of common configuraiton values are updated to
+    Legacy sources of common configuration values are updated to
     reflect the new configuration; this may be removed in some future
     version.
     """
Index: src/App/tests/testImageFile.py
===================================================================
--- src/App/tests/testImageFile.py	(revisão 0)
+++ src/App/tests/testImageFile.py	(revisão 0)
@@ -0,0 +1,28 @@
+import unittest
+import App
+from Testing.ZopeTestCase.warnhook import WarningsHook
+
+
+class TestImageFile(unittest.TestCase):
+
+    def setUp(self):
+        # ugly: need to save the old App.config configuration value since
+        # ImageFile might read it and trigger setting it to the default value 
+        self.oldcfg = App.config._config
+        self.warningshook = WarningsHook()
+        self.warningshook.install()
+
+    def tearDown(self):
+        self.warningshook.uninstall()
+        # ugly: need to restore configuration, or lack thereof
+        App.config._config = self.oldcfg
+
+    def test_warn_on_software_home_default(self):
+        App.ImageFile.ImageFile('App/www/zopelogo.jpg')
+        self.assertEquals(self.warningshook.warnings.pop()[0],
+                          App.ImageFile.NON_PREFIX_WARNING)
+
+def test_suite():
+    return unittest.TestSuite((
+        unittest.makeSuite(TestImageFile),
+        ))
Index: src/App/ImageFile.py
===================================================================
--- src/App/ImageFile.py	(revisão 114644)
+++ src/App/ImageFile.py	(cópia de trabalho)
@@ -18,6 +18,7 @@
 import os.path
 import stat
 import time
+import warnings
 
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from Acquisition import Explicit
@@ -34,6 +35,13 @@
     os.path.join(os.path.dirname(Zope2.__file__), os.path.pardir)
     )
 
+NON_PREFIX_WARNING = ('Assuming image location to be present in the Zope2 '
+                      'distribution. This is deprecated and might lead to ' 
+                      'broken code if the directory in question is moved ' 
+                      'to another distribution. Please provide either an '
+                      'absolute file system path or a prefix. Support for ' 
+                      'relative filenames without a prefix might be '
+                      'dropped in a future Zope2 release.')
 
 class ImageFile(Explicit):
     """Image objects stored in external files."""
@@ -43,9 +51,12 @@
     def __init__(self, path, _prefix=None):
         import Globals  # for data
         if _prefix is None:
-            _prefix=getattr(getConfiguration(), 'softwarehome', PREFIX)
+            _prefix=getattr(getConfiguration(), 'softwarehome', None) or PREFIX
+            if not os.path.isabs(path):
+                warnings.warn(NON_PREFIX_WARNING, UserWarning, 2 )
         elif type(_prefix) is not type(''):
             _prefix=package_home(_prefix)
+        # _prefix is ignored if path is absolute
         path = os.path.join(_prefix, path)
         self.path=path
         if Globals.DevelopmentMode:
