Re: Relative file paths for images

Jay Smith-6 wrote:


I am new here, but....

Dia files "filename.dia" are XML plain text files.  They can be edited 
with a PLAIN text editor that does not add any formatting.  For example, 
since you are talking about C:, you must be on Windoze, thus you could 
use Notepad.

First, make a backup copy of the file!!!!!!

Then open the file and search in it for some portion of the filename or 
pathname, or perhaps "png".

There you will see what Dia thinks the path is and how it is structured.

I don't know how it works on Windoze and I don't know what version of 
Dia you are using or if it works differently than the version I am using 
(either 0.97 or 0.98 -- I installed 0.98, but it is telling me it is 
0.97 ... on LINUX).

On *MINE* it *IS* putting in relative pathnames to the images.  But that 
is because I can go to a particular directory before I start Dia from 
the command line.  I do not know if you have a command line method for 
starting Dia on Windoze.  Thus on *MINE*, if I start Dia from a command 
line while I am in a MyDiaStuff directory and my images are in the same 
directory, the image information in the .dia file simply has just the 
image filename.  However, if I am in /home/myname when I start Dia and 
then I import the image from /home/myname/MyDiaStuff, then the image 
information in the .dia file is "MyDiaStuff/filename.png"

If you don't solve the relative path problem, then you can either a) 
"simply" change the information in the .dia files; b) you can create 
links to the image directories on Windoze (can Windoze do that?); c) you 
can move the image directories to be where your files expect them to be 
(which you don't want to do).

If you have lots of documents, there are methods to make these kind of 
find/replace changes using a script (batch command file), but since I 
don't use modern Windoze, I don't know the name of the Windoze program 
used for that.  But, with the right command you could change the paths 
in thousands of files all at once.  (Just MAKE BACKUPS FIRST; it can be 
tricky because of the slash and backslash characters which may need to 
be escaped (protected)).

If you have just one diagram, then you could use the find/replace in a 
text editor like Notepad (to change the current absolute path to a 
different absolute path).  The key, however, is to NOT use a text editor 
that changes or adds any formatting.


Okay thanks, yes this would work (although it took me a while to figure out
that in order it to read it in a text editor you have to specify
'uncompressed' in the save properties). 

And also, seems the paths are relative - I was just confused since in the
image properties Dia wants a full path to the image.  If you edit an image
and instead of clicking "Browse" you type the filename using a relative path
it shows up a broken image.  But if you specify the full path it works (ex-
C:\my project\etc) ... yet it in the .dia file the path is relative. Odd.   

So I guess my feedback is that relative file paths within the "Image
properties" window should work better. 
View this message in context:
Sent from the Gnome - Dia mailing list archive at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]