--- ditaa.orig/src/org/stathissideris/ascii2image/core/HTMLConverter.java	2016-12-05 23:24:13.155516000 -0500
+++ ditaa/src/org/stathissideris/ascii2image/core/HTMLConverter.java	2016-12-05 23:41:09.816397101 -0500
@@ -161,7 +161,7 @@
 		
 		System.out.println("Generating diagrams... ");
 		
-		File imageDir = new File(new File(targetFilename).getParent() + File.separator + imageDirName);
+		File imageDir = new File(new File(targetFilename).getAbsoluteFile().getParent() + File.separator + imageDirName);
 		if(!imageDir.exists()){
 			if(!imageDir.mkdir()){
 				System.err.println("Could not create directory " + imageDirName);
@@ -171,7 +171,7 @@
 		
 		for(String URL : diagramList.keySet()) {
 			String text = (String) diagramList.get(URL);
-			String imageFilename = new File(targetFilename).getParent() + File.separator + URL;
+			String imageFilename = new File(targetFilename).getAbsoluteFile().getParent() + File.separator + URL;
 			if(new File(imageFilename).exists() && !options.processingOptions.overwriteFiles()){
 				System.out.println("Error: Cannot overwrite file "+URL+", file already exists." +
					" Use the --overwrite option if you would like to allow file overwrite.");
 				continue;
