cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: decoding base64 tiff files embedded in XML
Date Thu, 13 Jun 2002 14:40:44 GMT
> From: John Moylan [mailto:john@nua-tech.com]
> 
> Hi,
> 
> I'm new to this list and to Cocoon2, however I need to develop an
application
> which transforms NewsML feeds into regular HTML for browsing. Easy you
say,
> right? Anyway the part I'm am having difficulty with is in converting
base64
> embedded tiff images into png on the fly.
>
> 	I don't know much about Java. I have a one liner in Perl which
decodes
> the tiff from the shell prompt:
> 
> 	perl -MMIME::Base64 -ne 'print decode_base64($_)'
</home/john/tiff.64
> >j.tiff
> 
> 	and an one liner which uses imagemagick's convert from the
shell:
> 
> 	convert j.tiff j.png
> 
> Can I somehow use turn one or both, of these one liners into sitemap
> generators (is that the right term.)

There are many approaches you can take. Depends on what level of
reusability of your components you want to achieve and details of input
format (never seen NewsML...).

If input is XML with data and images intermixed, use fragment extractor.

If input is XML, one way is to write serializer which takes input XML
with base64 encoded image and outputs image. It can also convert image
from tiff to png (using some Java image manipulation library).

If input is not XML, then you should write reader, which will read
base64, decode it, and write image as output (converting as necessary).


Vadim


> or is their any easier/better way. I can
> preprocess my XML files from the command line, but that does not seem
like a
> very elegant/manageable solution.
> 


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message