URIs.jl icon indicating copy to clipboard operation
URIs.jl copied to clipboard

Data URI scheme parsing

Open s-celles opened this issue 1 year ago • 3 comments

Hello,

I wonder if URIs can parse data URI scheme ie https://datatracker.ietf.org/doc/html/rfc2397

An example can be found here

https://gist.githubusercontent.com/scls19fr/8d2330ae8c2ded145c80b1650500bed2/raw/90373199aaa65581b7919f34c568562c9641c5d4/sample_img.jl

Kind regards

PS : related issue might be https://github.com/JuliaLang/Downloads.jl/issues/122 RegExp that could be used https://gist.github.com/khanzadimahdi/bab8a3416bdb764b9eda5b38b35735b8

s-celles avatar Mar 02 '24 21:03 s-celles

We don't currently support this, but PRs are always welcome!

quinnj avatar Mar 12 '24 04:03 quinnj

Let's first discuss of the scope of such a PR.

Do you have an API idea? Can/should I use some dependencies?

Can I use for example MIMEs.jl ? Should I create a separated module? (or maybe should such a contribution be in a separate repository?)

Should we return image from Images.jl if mimetype is for example image/jpeg (same for other kind of mimetype) or do we simply return base64 encoded data?

Do we also accept creating data uri from file as python-datauri is doing ?

s-celles avatar Mar 12 '24 07:03 s-celles

I opened a PR https://github.com/JuliaWeb/URIs.jl/pull/59/ to have a discussion about implementation details.

s-celles avatar Mar 12 '24 10:03 s-celles