Bug 38135 - [PATCH] Support for data urls (rfc 2397)
Summary: [PATCH] Support for data urls (rfc 2397)
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: trunk
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-05 13:31 UTC by Richard Wheeldon
Modified: 2012-04-01 07:01 UTC (History)
0 users



Attachments
Patch for FOURIResolver (2.06 KB, patch)
2006-01-05 13:32 UTC, Richard Wheeldon
Details | Diff
Test case with embedded image. (14.77 KB, text/plain)
2006-01-05 13:33 UTC, Richard Wheeldon
Details
Updated patch using batik's decoder. (2.12 KB, patch)
2006-01-05 14:20 UTC, Richard Wheeldon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Wheeldon 2006-01-05 13:31:10 UTC
Adds support for inline images in the form of base64 encoded data urls.
This is particularly useful for displaying FO files generated from Word
docs.

Requires commons-codec.

For details of word to fo conversion see:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E0FAA0AF-A185-4296-B74D-A9FE870C92CC&displaylang=en

For details of the data url scheme see:
http://www.ietf.org/rfc/rfc2397
Comment 1 Richard Wheeldon 2006-01-05 13:32:03 UTC
Created attachment 17334 [details]
Patch for FOURIResolver
Comment 2 Richard Wheeldon 2006-01-05 13:33:05 UTC
Created attachment 17335 [details]
Test case with embedded image.
Comment 3 Jeremias Maerki 2006-01-05 14:07:47 UTC
Richard, thanks for the patch. I'd prefer not to add a dependency on a whole new
library for just one class. Would you mind rewriting your patch to use Batik's
org.apache.batik.util.Base64DecodeStream? I'll gladly apply your patch then.

Some time ago I also posted a generic solution to this problem, found here:
http://marc.theaimsgroup.com/?l=fop-user&m=110875657902117&w=2 (Just for
completeness)

We might switch to Batik's ParsedURL infrastructure in the future which
automatically gives us RFC2397 support, but your solution will certainly help in
the meantime.
Comment 4 Richard Wheeldon 2006-01-05 14:20:41 UTC
Created attachment 17336 [details]
Updated patch using batik's decoder.
Comment 5 Jeremias Maerki 2006-01-05 15:05:17 UTC
Thanks, Richard. That didn't take you long to change that patch. :-) Patch
applied: http://svn.apache.org/viewcvs?rev=366184&view=rev

Note to myself: Make sure the base64 stuff goes into Commons so we don't have a
dependency on Batik in FOURIResolver in the long run.
Comment 6 Glenn Adams 2012-04-01 07:01:06 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed