BATIK-966 still persists (moved from useres list)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

BATIK-966 still persists (moved from useres list)

Jan Hill

Hello mailinglist,

thats my frist post here, i am not a native speaker, if I make a mistake, please give me a hint.

First thanks for batik :-)

I run in the same problem which is described here:

https://issues.apache.org/jira/browse/BATIK-966

I am sure there is am bug, if the base64 string/stream has whitespaces ( SPACE; LF; CRLF; CR).

If you handle base64 strings you have to ignore whitespaces.

See below. Is there a chance to get them fixed? Or for wich class should this fix developed?

One solution could be:

org.apache.batik.transcoder.image.ImageTranscoder

...

import org.apache.batik.transcoder.keys.PaintKey;
+import org.apache.commons.lang3.StringUtils
import org.w3c.dom.Document;

...

    protected void transcode(Document document,
                             String uri,
                             TranscoderOutput output)
            throws TranscoderException {

+        StringUtils.deleteWhitespace(uri);
        // Sets up root, curTxf & curAoi
        super.transcode(document, uri, output);

        // prepare the image to be painted

...


But you have to add

import org.apache.commons.lang3.StringUtils

so i didn't know your package architecture policy


A solution for this bug would be great.

regards

Jan



Caused by: org.apache.batik.transcoder.TranscoderException: null

Enclosed Exception:

:0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ.....RRQAUUUUAFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:226)

         at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)

         at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)

         at de.bdr.goid.idms.data.prepress.eprint.BatikPrepress$BatikPrintable.producePNGTo(BatikPrepress.java:163)

         ... 118 common frames omitted

Caused by: org.apache.batik.bridge.BridgeException: :0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgAB.....AFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.bridge.UserAgentAdapter.getBrokenLinkDocument(UserAgentAdapter.java:448)

         at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:641)

         at org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:231)

         at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:179)

         at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:121)

         at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)

         at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)

         ... 122 common frames omitted
Reply | Threaded
Open this post in threaded view
|

Re: BATIK-966 still persists (moved from useres list)

Jan Hill

I think BATIK-870 is the same issue.

Am 08.03.2020 um 17:52 schrieb Jan Hill:

Hello mailinglist,

thats my frist post here, i am not a native speaker, if I make a mistake, please give me a hint.

First thanks for batik :-)

I run in the same problem which is described here:

https://issues.apache.org/jira/browse/BATIK-966

I am sure there is am bug, if the base64 string/stream has whitespaces ( SPACE; LF; CRLF; CR).

If you handle base64 strings you have to ignore whitespaces.

See below. Is there a chance to get them fixed? Or for wich class should this fix developed?

One solution could be:

org.apache.batik.transcoder.image.ImageTranscoder

...

import org.apache.batik.transcoder.keys.PaintKey;
+import org.apache.commons.lang3.StringUtils
import org.w3c.dom.Document;

...

    protected void transcode(Document document,
                             String uri,
                             TranscoderOutput output)
            throws TranscoderException {

+        StringUtils.deleteWhitespace(uri);
        // Sets up root, curTxf & curAoi
        super.transcode(document, uri, output);

        // prepare the image to be painted

...


But you have to add

import org.apache.commons.lang3.StringUtils

so i didn't know your package architecture policy


A solution for this bug would be great.

regards

Jan



Caused by: org.apache.batik.transcoder.TranscoderException: null

Enclosed Exception:

:0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ.....RRQAUUUUAFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:226)

         at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)

         at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)

         at de.bdr.goid.idms.data.prepress.eprint.BatikPrepress$BatikPrintable.producePNGTo(BatikPrepress.java:163)

         ... 118 common frames omitted

Caused by: org.apache.batik.bridge.BridgeException: :0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgAB.....AFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.bridge.UserAgentAdapter.getBrokenLinkDocument(UserAgentAdapter.java:448)

         at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:641)

         at org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:231)

         at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:179)

         at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:121)

         at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)

         at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)

         ... 122 common frames omitted
Reply | Threaded
Open this post in threaded view
|

RE: BATIK-966 still persists (moved from useres list)

Simon Steiner
In reply to this post by Jan Hill

Hi,

 

Can you attach as a patch to a jira bug.

 

Thanks

 

From: Jan Hill <[hidden email]>
Sent: 08 March 2020 16:53
To: [hidden email]
Subject: BATIK-966 still persists (moved from useres list)

 

Hello mailinglist,

thats my frist post here, i am not a native speaker, if I make a mistake, please give me a hint.

First thanks for batik :-)

I run in the same problem which is described here:

https://issues.apache.org/jira/browse/BATIK-966

I am sure there is am bug, if the base64 string/stream has whitespaces ( SPACE; LF; CRLF; CR).

If you handle base64 strings you have to ignore whitespaces.

See below. Is there a chance to get them fixed? Or for wich class should this fix developed?

One solution could be:

org.apache.batik.transcoder.image.ImageTranscoder

...

import org.apache.batik.transcoder.keys.PaintKey;
+import org.apache.commons.lang3.StringUtils
import org.w3c.dom.Document;

...

    protected void transcode(Document document,
                             String uri,
                             TranscoderOutput output)
            throws TranscoderException {

+        StringUtils.deleteWhitespace(uri);
        // Sets up root, curTxf & curAoi
        super.transcode(document, uri, output);

        // prepare the image to be painted

...

 

But you have to add

import org.apache.commons.lang3.StringUtils

so i didn't know your package architecture policy

 

A solution for this bug would be great.

regards

Jan

 

 

Caused by: org.apache.batik.transcoder.TranscoderException: null

Enclosed Exception:

:0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ.....RRQAUUUUAFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:226)

         at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)

         at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)

         at de.bdr.goid.idms.data.prepress.eprint.BatikPrepress$BatikPrintable.producePNGTo(BatikPrepress.java:163)

         ... 118 common frames omitted

Caused by: org.apache.batik.bridge.BridgeException: :0

The URI "data:image/jpeg;base64,/9j/4AAQSkZJRgAB.....AFFFFABRRRQB/ /9k= "

on element <image> can't be opened because:

JPEG URL is corrupt or unsupported variant

         at org.apache.batik.bridge.UserAgentAdapter.getBrokenLinkDocument(UserAgentAdapter.java:448)

         at org.apache.batik.bridge.SVGImageElementBridge.createRasterImageNode(SVGImageElementBridge.java:641)

         at org.apache.batik.bridge.SVGImageElementBridge.createImageGraphicsNode(SVGImageElementBridge.java:231)

         at org.apache.batik.bridge.SVGImageElementBridge.buildImageGraphicsNode(SVGImageElementBridge.java:179)

         at org.apache.batik.bridge.SVGImageElementBridge.createGraphicsNode(SVGImageElementBridge.java:121)

         at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:213)

         at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:171)

         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:82)

         at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)

         ... 122 common frames omitted