On 09. des. 2010 10:18, Stephan Witt wrote:
[...]
Cut&paste image to some other part of the document? Then, don't change the
filename at all. It will keep working.
Cut&paste image to some unrelated document? The most important then
is that it still works. There will be cases where a conversion to
absolute path will be necessary, e.g. different drive letter on windows. Ideally, some
effort could be used to keep a relative path relative, at least for the common case where
the new relative path won't have to start with "..". (I.e. the common case
where the user is copying images between documents that reside in the same document
directory.)
reside in the same
That sounds reasonable.
What do you propose if the application is not able to decide if the contents of
the clipboard is from the same document?
I'm not completely sure if this is the case... but it looks so - at least on a
mac currently.
Not knowing where the paste comes from doesn't really matter. Just check
the filename.
If the paste comes from the same document (or any document in the same
directory) then the filename in the pasted image works. So just use it.
If the filename doesn't work as-is, then it clearly comes from somewhere
else. Altering the path will be necessary. The code probably will need
to know where it came from in this case - in order to find the file at
all. If the name is "images/test.jpg", then it is in some "images"
subdirectory, but which one? A mac really provides no information on
where pasted material comes from? If so, then it is necessary to provide
an absolute path for any external material that goes to the clipboard.
(In addition to, not instead of the "normal" path which may be absolute
or relative depending on user preference.)
Helge Hafting