
2009/12/27 Aaron Spike <aaron@...749...>:
Valerie wrote:
On the issue of linking vs embedding images: can't we just have 2 commands?
- Embed an image
- Link an image
Certainly, but the problem is when the command is implicit in the action, such as Drag-and-Drop. Which should we choose?
I would favor embedding in such a case. This would be consistent with e.g. OpenOffice and GIMP. When you drag or paste something into the document in those apps, you create a local copy of it, so users should be familiar with this concept. In fact we already use this approach when importing or DnDing SVG documents. The popup can be shown in response to middle dragging: in Nautilus it asks whether to paste files, move files or paste links.
A further important reason to prefer embedding is that it's simply not possible to accidentally "break" a document with embedded images. If there is ambiguity, embedding is the safe default.
The change required to embed on image paste is actually rather simple, and consists of copying code that starts at interface.cpp:1452 to ui/clipboard.cpp:866. For bonus points, the import snippets in interface.cpp could be refactored into public functions and moved to file.h, which would simplify the changes needed for import dialog.
With out thinking about users and workflows, I would like to see:
- some on canvas indication of whether an image is linked or embeded.
just something, perhaps a little icon.
Good idea. A small icon could appear in the corner of the selection cue when the image is selected. This requires a change to the _updateItemBboxes() method in selcue.cpp:61.
- a simple way of converting an image between the two states. I would
like a context menu, but others might have better ideas.
Currently there are extensions available for those tasks, but it's not obvious where to look for them. There should be 1 left-click menu item that would depend on the image's embed state: either "Embed", which would embed the image, or "Extract...", which would bring up a save dialog that allows the user to pick a location for the image; there should be an option to use a relative or absolute path, with the default being relative (most users will probably keep the linked images in the same directory or a subdir). The relevant place is context-menu.cpp:399.
Regards, Krzysztof