xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes (Jira)" <j...@apache.org>
Subject [jira] [Commented] (FOP-3022) Embedded PNG and PNG with relative path: No ImagePreloader found
Date Thu, 22 Jul 2021 09:40:00 GMT

    [ https://issues.apache.org/jira/browse/FOP-3022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17385380#comment-17385380
] 

Johannes commented on FOP-3022:
-------------------------------

The image URL for the embedded PNG in the above message is invalid, here is a valid one (having
the same issue):

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAIAAAAI7H7bAAAMVUlEQVR42u3doXYjSRKFYQMDP4yBQQNBPZCBgaDeq4FBAz+CH0CggUADA0MDj2b27JzdPavWhHyjUqr67mlURy1lVfmvrLgZGXHzSURf1o1LQAQkIiARAYmIgEQEJCIgEQGJiIBEBCQiIBEBiYiARAQkIiARAemfaLfbbbfb9Xp9d3d3Q3RVOvzRrlarzWbz+vo6DKSPj4+np6fb21v3g2agx8fH9/f3qUHa7/cHlF19mpPu7+9//vw5HUiHuQhFNFeWzpuXzgHp8EbnitOM3/GmAGm324mLaN46w3sog7Tdbl1omrc2m007SOv12oWmeWu1WrWDZL2IZq/DH3k7SK4yLUFAIgISEZCIgAQkIiARAYkISKf18PDw/fv3/X5v+xdNqbe3tx8/fnz79m0OIB0o+so2D6Iv6rzNChcH0vPzs3tJY/Xy8nL1IHmjo0t4x7t6kNxFugQBiQhIQCIgAYmABKSadp+79ef65nB+f/1bfa4OR35z/HO3+1yv/3345nO1+vPI0cNHjx8dT/HzR8dTPK+jx6vnVRxP9YSr1wdIE+k/7+7f9/g3x//rNv59M48ePnr86HiKnz86nuJ5HT1ePa/ieKonXL0+QJpq6v/f+/Lnv98c/3+Hb44fPnr8+HWuff7oeIrndfR49byK46mecP16AglIQAISkIAEJDGSGEmMBCSuHdcOSETWkc4fUPlJXJxhYuOpPqJTJxY6gerM0z1jdF+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NpB2u12t7e3rjXNWK+vr+0gHfT09ORa01z1+Ph4zn6nydJpiS5f9/f3521WOHMH636/xxLNj6Lduc1kzt8KfpiXDu944iWazRvdVzbOfbWmwoHg7Xa7Xq+tL9HV6fBHe3ix2mw2Z7gLYZCICEhEQCICEhGQiAhIREAiAhIRkIgISERAIgISEZCICEhEQCICEtFy9AdW6blzRo1prgAAAABJRU5ErkJggg==

> Embedded PNG and PNG with relative path: No ImagePreloader found
> ----------------------------------------------------------------
>
>                 Key: FOP-3022
>                 URL: https://issues.apache.org/jira/browse/FOP-3022
>             Project: FOP
>          Issue Type: Bug
>          Components: image/png
>    Affects Versions: 2.6
>            Reporter: Johannes
>            Priority: Major
>
> A PDF with an embedded PNG and another PNG with a relative URL does not contain either
of these images (as it worked before in FOP version 2.3).
> This is the error reported in the debug trace:
> Image not available. URI: data:image/png;base64,0000C3E449BA11000000000000000000F33319879C248B7149B918E031DA9E37336F93FA7DE2500F377C435E31F7DCE86730D41D33A8.
Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported.
No ImagePreloader found for data:image/png;base64,0000C3E449BA11000000000000000000F33319879C248B7149B918E031DA9E37336F93FA7DE2500F377C435E31F7DCE86730D41D33A8
(No context info available)
> org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported.
No ImagePreloader found for data:image/png;base64,0000C3E449BA11000000000000000000F33319879C248B7149B918E031DA9E37336F93FA7DE2500F377C435E31F7DCE86730D41D33A8
> Result of debugging (using FOP 2.6 sources):
>  * FOUserAgent.resolveURI creates a StreamSource from the PNG. The resource URI is correctly
resolved (i.e. the StreamSource has an InputStream on the PNG) but the method sets an invalid
systemId (the base URI of the resource resolver, which points to the config file, cfg.xml
in our case)
>  * AbstractImageSessionContext.newSource (from xmlgraphics-commons-2.6; instantiated
in the FOUserAgent constructor) uses the fallbackResolver for any StreamSource.
>  * AbstractImageSessionContext.UnrestrictedFallbackResolver.createSource quietly closes
the InputStream of the StreamSource and requests the systemId from ImageIO instead (code comment:
"We let the OS' file system cache do the caching for us --> lower Java memory consumption,
probably no speed loss")
> Thus it opens a stream on the cfg.xml instead of the image
>  * Consequentually, PreloaderRawPNG doesn't feel responsible for the wrong PNG because
it doesn't start with the PNG signature (PNGConstants.PNG_SIGNATURE) - which is caused by
reading a completely different file than the PNG
> Same behaviour also for another PNG included with a simple relative file URL (<fo:external-graphic
src="url('subdir/myimage.png')" /> hardcoded in the XSL).
> The issue is reproducible as well when running the generation standalone from the command
line (using -xml, -xsl and -pdf options).
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message