Milan Nikl created BATIK-1353:
---------------------------------

             Summary: 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.16, 1.12
         Environment: Simple JUnit test, on Java 11, unix.
            Reporter: Milan Nikl
         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