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

Stanimir Stamenkov edited comment on BATIK-1353 at 11/2/23 7:15 AM:
--------------------------------------------------------------------

bq. ... the sheer size of the Exception instance is enormous.

Could you attach a text file with the full trace, nevertheless?  What Java 
runtime/version is used?  Are additional libraries such as XML parsers being 
plugged in?  Certain configurations may have tighter 
[limits|https://docs.oracle.com/javase/tutorial/jaxp/limits/limits.html] set up.

Using Batik 1.17, this one appears to work for me:

{code:none}
> java -jar batik-rasterizer-1.17.jar uniforce-favicon-rot.svg
About to transcode 1 SVG file(s)

Converting uniforce-favicon-rot.svg to uniforce-favicon-rot.png ... ... success

> java -jar batik-rasterizer-1.17.jar -m image/jpeg uniforce-favicon-rot.svg
About to transcode 1 SVG file(s)

Converting uniforce-favicon-rot.svg to uniforce-favicon-rot.jpg ... ERROR: The 
JPEG quality has not been specified. Use the default one: medium compression
... success
{code}



was (Author: stanio):
bq. ... the sheer size of the Exception instance is enormous.

Could you attach a text file with the full trace, nevertheless?  What Java 
runtime/version is used?  Are additional libraries such as XML parsers being 
plugged in?  Certain configurations may have tighter 
[limits|https://docs.oracle.com/javase/tutorial/jaxp/limits/limits.html] set up.

Using Batik 1.17, this one appears to work for me:

{noformat}
> java -jar batik-rasterizer-1.17.jar uniforce-favicon-rot.svg
About to transcode 1 SVG file(s)

Converting uniforce-favicon-rot.svg to uniforce-favicon-rot.png ... ... success

> java -jar batik-rasterizer-1.17.jar -m image/jpeg uniforce-favicon-rot.svg
About to transcode 1 SVG file(s)

Converting uniforce-favicon-rot.svg to uniforce-favicon-rot.jpg ... ERROR: The 
JPEG quality has not been specified. Use the default one: medium compression
... success
{noformat}


> BridgeException params should be trimmed if possible
> ----------------------------------------------------
>
>                 Key: BATIK-1353
>                 URL: https://issues.apache.org/jira/browse/BATIK-1353
>             Project: Batik
>          Issue Type: Bug
>          Components: Bridge
>    Affects Versions: 1.12, 1.16
>         Environment: Simple JUnit test, on Java 11, unix.
>            Reporter: Milan Nikl
>            Priority: Major
>         Attachments: uniforce-favicon-rot.svg
>
>
> While processing image downloaded from 
> https://www.uniforce.at/wp-content/uploads/uniforce-favicon-rot.svg 
> [^uniforce-favicon-rot.svg] and trying to transcode it to JPEG via 
> _JPEGTranscoder_ I'm getting a 
> _org.apache.batik.transcoder.TranscoderException_ wrapping a 
> _org.apache.batik.bridge.BridgeException_ saying:
> {{The URI "data:image/png;base64,..." on element <image> can't be opened 
> because: PNG URL is corrupt or unsupported variant.}}
> Which is kind of OK if the file can't be processed properly.
>  
> The problem is that there is base64 encoded content and the text of a broken 
> URI is about 850600 characters long. Given the nature of Java Exception being 
> wrapped by multiple super types and containing all kind of information and 
> stacktrace, the sheer size of the Exception instance is enormous.
>  
> The _org.apache.batik.bridge.UserAgentAdapter#getBrokenLinkDocument_ method 
> called inside
> _org.apache.batik.bridge.SVGImageElementBridge#createRasterImageNode_ should 
> use some reasonable trimming of given url if possible. Not only to limit size 
> of an Exception thrown, but also for some safety reasons as the image content 
> probably should not be published in a Throwable's message.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org

Reply via email to