Fix T47360: Image loading fails when accessible from the CWD
authorCampbell Barton <ideasman42@gmail.com>
Mon, 8 Feb 2016 07:19:50 +0000 (18:19 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 8 Feb 2016 07:21:20 +0000 (18:21 +1100)
release/scripts/modules/bpy_extras/image_utils.py

index f197596fec03090659933dfcc7c85b74f2eb0ff8..d078d63a41779feefd45e1df63b9e8f1ab094d63 100644 (file)
@@ -95,6 +95,10 @@ def load_image(imagepath,
         if convert_callback:
             path = convert_callback(path)
 
+        # Ensure we're not relying on the 'CWD' to resolve the path.
+        if not os.path.isabs(path):
+            path = os.path.abspath(path)
+
         try:
             image = bpy.data.images.load(path, check_existing)
         except RuntimeError: