You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marc Salvetti <sa...@gmail.com> on 2007/04/02 08:37:00 UTC

Re: raster (jpeg, png) graphics in Batik SVG rasterizer under Cocoon

Hi Wendell,

i had a similar pb and it was because of
org.apache.cocoon.xml.dom.SVGBuilder.java and a pb in the endDocument
function because of a bad base url and something about a call to the
setDocumentLocator function.
I didn't really solved the issue, just pointed it and changed it to fit my
needs.
Look in the logs if you have something like *setDocumentLocator was not
called, will use ....as base uri*

HTH,

Marc

2007/4/2, Wendell Piez <wa...@mulberrytech.com>:
>
> Hi,
>
> When serving SVGs with Cocoon, if I call a jpeg or PNG image into an
> SVG file and the Cocoon sitemap is configured to deliver them, I can
> see them just fine in the SVG in a browser. But when I pass the same
> SVG through Batik's rasterizer under Cocoon to make a jpeg (or png),
> the jpeg or png fails to be included, instead showing me a nice but
> alarming placeholder image. (I can arrange for examples on request,
> and/or show my sitemap.)
>
> When I run Batik standalone (as a client) and point them to the SVGs
> (being delivered by Cocoon), it behaves just like any SVG browser,
> displaying the jpeg or PNG and even offering me the rasterize
> functionality. It's when it's running on the server that it doesn't work.
>
> Does anyone have any hints as to whether (and how) it's possible to
> get Batik to resolve and include these images when rasterizing under
> Cocoon?
>
> Regards,
> Wendell
>
>
>
> ======================================================================
> Wendell Piez                            mailto:wapiez@mulberrytech.com
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>    Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: raster (jpeg, png) graphics in Batik SVG rasterizer under Cocoon

Posted by Wendell Piez <wa...@mulberrytech.com>.
Joerg,

At 02:51 AM 4/3/2007, you wrote:
>>>can it be just a problem of source resolving? PDF and JPG/PNG 
>>>serializers suffered from the lack of being able to resolve 
>>>relative paths for ages. This was only recently fixed in the FOP 
>>>NG block on trunk for PDF, but I don't know of any fix for Batik.
>>Marc, are you implying that if I use absolute URIs that'll work? 
>>Worth a try, for sure. (And something I should have thought of. :-)
>
>Absolute URIs should work without any problem.

Thanks, I'll definitely try that the next time I get my hands on it. 
(Tonight, I hope.)

>The actual problem with old FOP was the integration in Cocoon - or 
>more specific the injection of Cocoon's source resolver into FOP. 
>This was of particular interest when you wanted to include 
>dynamically generated images from another Cocoon pipeline.
>
>If it is easier for Batik to inject Cocoon's source resolver or even 
>easier to just set the base URI - I have no idea and have never 
>tried to investigate it. Including other resources was more often a 
>need with FOP than with Batik.

Understood. (Does anyone have a clue of how to check on the issue in Batik?)

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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


Re: raster (jpeg, png) graphics in Batik SVG rasterizer under Cocoon

Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.04.2007 22:52, Wendell Piez wrote:

>> can it be just a problem of source resolving? PDF and JPG/PNG 
>> serializers suffered from the lack of being able to resolve relative 
>> paths for ages. This was only recently fixed in the FOP NG block on 
>> trunk for PDF, but I don't know of any fix for Batik.
> 
> Marc, are you implying that if I use absolute URIs that'll work? Worth a 
> try, for sure. (And something I should have thought of. :-)

Absolute URIs should work without any problem.

The actual problem with old FOP was the integration in Cocoon - or more 
specific the injection of Cocoon's source resolver into FOP. This was of 
particular interest when you wanted to include dynamically generated 
images from another Cocoon pipeline.

If it is easier for Batik to inject Cocoon's source resolver or even 
easier to just set the base URI - I have no idea and have never tried to 
investigate it. Including other resources was more often a need with FOP 
than with Batik.

Regards
Joerg

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


Re: raster (jpeg, png) graphics in Batik SVG rasterizer under Cocoon

Posted by Wendell Piez <wa...@mulberrytech.com>.
Hi Marc,

At 02:37 AM 4/2/2007, you wrote:
>i had a similar pb and it was because of 
>org.apache.cocoon.xml.dom.SVGBuilder.java and a pb in the 
>endDocument function because of a bad base url and something about a 
>call to the setDocumentLocator function.
>I didn't really solved the issue, just pointed it and changed it to 
>fit my needs.
>Look in the logs if you have something like *setDocumentLocator was 
>not called, will use ....as base uri*

This is in line with Joerg's idea, and more or less my best guess too.

To answer the question Jeroen asked, I'm still seeing the problem in 
Cocoon 2.1.10 under Windows XP.

In the SVG, the URIs to the jpegs are relative. How is the base uri 
of the SVG defined for the rasterizer, if it is generated 
dynamically? (The jpegs are relative to the source XML, and as I 
said, when pointing Batik at the generated SVGs, it finds the jpegs; 
it's the rasterizer that doesn't.)

So it sounds to me like Joerg is on the right track:
>can it be just a problem of source resolving? PDF and JPG/PNG 
>serializers suffered from the lack of being able to resolve relative 
>paths for ages. This was only recently fixed in the FOP NG block on 
>trunk for PDF, but I don't know of any fix for Batik.

Marc, are you implying that if I use absolute URIs that'll work? 
Worth a try, for sure. (And something I should have thought of. :-)

If anyone has any other good ideas I'd love to hear them.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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