mofosyne / tagdrop

allows for reading datauris, and displaying the media as if it was html or text or sound etc...
GNU General Public License v3.0
14 stars 2 forks source link

extending datauri syntax #2

Open mofosyne opened 9 years ago

mofosyne commented 9 years ago

datauri syntax can be rather limiting. What if you want to split the string over multiple tags? What about adding compression? What if the encoding is in binary?

The general syntax is

 data:[<MIME-type>][;charset=<encoding>][;base64],<data>

We can extend by including:

So via these extensions, we could make data uri do double duty as a manifest perhaps;

xloem commented 9 years ago

Once you are storing raw binary data in a data: uri I'm not sure any other application will be able to process it, and I'd question the choice to still use the structure of the data: uri here if something else might better do the job. But they'd work.

Note that zxing can be used to process out-of-order structured append codes if you process the SA information by hand from the raw data. But it will not generate them yet.

mofosyne commented 9 years ago

The use of uri. At least for the first QR code you scan, is for the convenience of activating the program from zxing barcode scanner (which would be more convenient than having to open tagdrop or qrstream to scan the same code initially) . The actual binary data can be stored as normal in subsequent QR codes (tho how to work out the order would be a bit of an issue, unless we are relying on users to scan properly in sequence).

But yea, I am leaning towards just baking our own standard. What do you think about using the word "MANIFEST:" as the trigger word for zxing barcode reader to open our program, and storing the settings as a json data structure (unless you have a different idea)?


p.s. For structured append, I guess we have to assume users won't know how to generate it. So having the manifest QR code store a sequence of truncated hashes (e.g. md5:[h242,j42j34,53aj]) or optionally for text, a sequence of the first few characters of each barcode sequence (e.g. seq:["#section1","#section2"]) could be more manageable and transparent.

Info about various hash functions