No subject


Sun May 31 08:28:51 EDT 2009


	<walterbender>	silbe: you are a DS/Journal guru... I have a question
	<walterbender>	silbe: I generate svg files in TA and write them to
the datastore as their own journal entry.
	<walterbender>	silbe: works fine except I have a problem with embedded images.
	<walterbender>	silbe: I use xlink:xml="file:///..." to refer to the
path returned by dsobject.file_path, but that seems to be a temp.
reference, so when I go back to the svg object later, the path is
invalid
	<walterbender>	silbe: is there a way to find the actual path to, say
a png file in the datastore, that I can then reference, or do I need
to copy the data to the filesystem in order to reliably refer to it.
	<silbe>	walterbender: Would embedding the image data directly be a good option?
	<silbe>	walterbender: or should it stay in sync with the copy in the
data store?
	<walterbender>	silbe: I suppose I could encode the data and put it
into the SVG file itself... but it would be nice to be able to
reference (sync) to the file--much more efficient.
	<walterbender>	silbe: I do exactly that (embed images) in my HTML
output in TA... but it makes the HTML code unreadable for kids
	<walterbender>	silbe: maybe this needs to be resolved as part of a
general DS rethink...
	<walterbender>	silbe: we have a lot of work for you once you finish
your thesis :)
	<silbe>	walterbender: since you cannot rely on file names I can think
of two options: a) use CID-references like in emails and resolve them
inside TA or b) create symlinks (on each run of TA)
	<walterbender>	silbe: the issue is not TA. I want to use TA to make
SVGs that other activities can use.
	e.g., Browse
	<silbe>	walterbender: The most portable way to do it is to embed the data then.
	<walterbender>	silbe: yeah. I was afraid of that. Readability and
efficiency get thrown out. I was hoping there was another way.
	<silbe>	walterbender: with Browse using a zip bundle might work, but
that'd duplicate the data again instead of referencing
	<walterbender>	silbe: I suppose I could wrap the SVG into a zip
bundle with the related images...
	<silbe>	walterbender: we could invent a new URL (URI?) scheme to
reference data store entries, but that would obviously need to be
supported in each activity. We can add common code to parse & resolve
those URLs, but the activities need to actually use that code (as the
parts that reference other entries are activity-specific).
	<silbe>	walterbender: How about discussing it (way to reference data
store entries) on sugar-devel? If we can get consensus on how to do
it, I'll give it a try. After doing some bug squashing, that is. :)

-walter

-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list