[ 
https://issues.apache.org/jira/browse/FOP-2842?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Hajduch updated FOP-2842:
--------------------------------
    Description: 
Please see also: [https://github.com/haraldk/TwelveMonkeys/issues/476]

When using Batik 1.11 / FOP 2.3 / TwelweMonkey's ImageIO 3.4.1, 
<fo:instream-foreign-object> with embedded SVG image does not work correctly.

What happens is, that org.apache.fop.render.intermediate.AbstractIFPainter 
class creates ImageInfo object with URI being null, through this piece of code:
{quote}protected void drawImageUsingDocument(final Document doc,
         final Rectangle rect) {
     final ImageManager manager = getFopFactory().getImageManager();
     ImageInfo info = null;
     try {
         info = manager.preloadImage({color:#d04437}*null*{color}, new 
DOMSource(doc));
{quote}
 

This subsequently failes in FOP's InternalResourceResolver, which contains code:
{quote}public Resource getResource(String stringUri) throws IOException, 
URISyntaxException {
     if ({color:#d04437}*stringUri.startsWith*{color}("data:")) {
        return new Resource(resolveDataURI(stringUri));         }
    return getResource(cleanURI(stringUri));
 }
{quote}
 

This obviously cannot work if stringUri is null.

 

When TwelweMonkey's ImageIO is removed from the classpath, and 
xmlgraphics-commons is used instead, it works _(PDF is generated)_.

 

However, I need ImageIO in my project for other tasks.

 

Any ideas?

  was:
Please see also: [https://github.com/haraldk/TwelveMonkeys/issues/476]

When using Batik 1.11 / FOP 2.3 / TwelweMonkey's ImageIO 3.4.1, 
<fo:instream-foreign-object> with embedded SVG image does not work correctly.

What happens is, that org.apache.fop.render.intermediate.AbstractIFPainter 
class creates ImageInfo object with URI being null, through this piece of code:
{quote}protected void drawImageUsingDocument(final Document doc,
         final Rectangle rect) {
     final ImageManager manager = getFopFactory().getImageManager();
     ImageInfo info = null;
     try {
         info = manager.preloadImage({color:#d04437}*null*{color}, new 
DOMSource(doc));
{quote}
 

This subsequently failes in FOP's InternalResourceResolver, which contains code:
{quote}public Resource getResource(String stringUri) throws IOException, 
URISyntaxException {
     if ({color:#d04437}*stringUri.startsWith*{color}("data:")) {
         return new Resource(resolveDataURI(stringUri));     
    }
    return getResource(cleanURI(stringUri));
 }
{quote}
 

This obviously cannot work if stringUri is null.

 

When TwelweMonkey's ImageIO is removed from the classpath, and 
xmlgraphics-commons is used instead, it works _(PDF is generated)_.

 

However, I need ImageIO in my project for other tasks.

 

Any ideas?


> Incompatibility between Batik / FOP / TwelweMonkey's ImageIO / 
> <fo:instream-foreign-object> tag
> -----------------------------------------------------------------------------------------------
>
>                 Key: FOP-2842
>                 URL: https://issues.apache.org/jira/browse/FOP-2842
>             Project: FOP
>          Issue Type: Bug
>            Reporter: Martin Hajduch
>            Priority: Major
>             Fix For: 2.3
>
>         Attachments: exception.txt
>
>
> Please see also: [https://github.com/haraldk/TwelveMonkeys/issues/476]
> When using Batik 1.11 / FOP 2.3 / TwelweMonkey's ImageIO 3.4.1, 
> <fo:instream-foreign-object> with embedded SVG image does not work correctly.
> What happens is, that org.apache.fop.render.intermediate.AbstractIFPainter 
> class creates ImageInfo object with URI being null, through this piece of 
> code:
> {quote}protected void drawImageUsingDocument(final Document doc,
>          final Rectangle rect) {
>      final ImageManager manager = getFopFactory().getImageManager();
>      ImageInfo info = null;
>      try {
>          info = manager.preloadImage({color:#d04437}*null*{color}, new 
> DOMSource(doc));
> {quote}
>  
> This subsequently failes in FOP's InternalResourceResolver, which contains 
> code:
> {quote}public Resource getResource(String stringUri) throws IOException, 
> URISyntaxException {
>      if ({color:#d04437}*stringUri.startsWith*{color}("data:")) {
>         return new Resource(resolveDataURI(stringUri));         }
>     return getResource(cleanURI(stringUri));
>  }
> {quote}
>  
> This obviously cannot work if stringUri is null.
>  
> When TwelweMonkey's ImageIO is removed from the classpath, and 
> xmlgraphics-commons is used instead, it works _(PDF is generated)_.
>  
> However, I need ImageIO in my project for other tasks.
>  
> Any ideas?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to