Browse Source

added support for relative image file names in InfoFile config (xml tag < image > )

Johannes Ruehle 13 years ago
parent
commit
9c9bbcd1ba
1 changed files with 7 additions and 1 deletions
  1. 7 1
      ImageLabeler.cpp

+ 7 - 1
ImageLabeler.cpp

@@ -2100,7 +2100,13 @@ ImageLabeler::loadInfo(QString filename)
 					return false;
 					/* NOTREACHED */
 				}
-				if (!image_->load(string)) {
+                QString sImageStr = string;
+                if( QFileInfo(string).isRelative() )
+                {
+                    sImageStr = QFileInfo(filename).path() + "/" + string;
+                }
+
+                if (!image_->load( sImageStr )) {
 					return false;
 					/* NOTREACHED */
 				}