diff --git a/src/main/java/writer2latex/xhtml/content/DrawParser.java b/src/main/java/writer2latex/xhtml/content/DrawParser.java index a473d34..cb43a8e 100644 --- a/src/main/java/writer2latex/xhtml/content/DrawParser.java +++ b/src/main/java/writer2latex/xhtml/content/DrawParser.java @@ -597,20 +597,25 @@ public class DrawParser extends Parser { } } else { - // In all other cases, create an img element - if (bgd!=null && !bgd.isLinked() && !bgd.isRecycled() && !bEmbedImg) { converter.addDocument(bgd); } - Element image = converter.createElement("img"); - String sName = Misc.getAttribute(getFrame(onode),XMLString.DRAW_NAME); - converter.addTarget(image,sName+"|graphic"); - if (!bEmbedImg || bgd.isLinked()) { - image.setAttribute("src",sFileName); - } - else { - StringBuilder buf = new StringBuilder(); - buf.append("data:").append(bgd.getMIMEType()).append(";base64,") - .append(DatatypeConverter.printBase64Binary(bgd.getData())); - image.setAttribute("src", buf.toString()); - } + // In all other cases, create an img element + if (bgd != null && !bgd.isLinked() && !bgd.isRecycled() && !bEmbedImg) { + converter.addDocument(bgd); + } + Element image = converter.createElement("img"); + String sName = Misc.getAttribute(getFrame(onode), XMLString.DRAW_NAME); + converter.addTarget(image, sName + "|graphic"); + if (!bEmbedImg || bgd.isLinked()) { + image.setAttribute("src", sFileName); + } else { + StringBuilder buf = new StringBuilder(); + buf.append("data:"); + buf.append(bgd.getMIMEType()); + buf.append(";base64,"); + if (bgd.getData() != null) { + buf.append(DatatypeConverter.printBase64Binary(bgd.getData())); + } + image.setAttribute("src", buf.toString()); + } // Add alternative text, using either alt.text, name or file name Element desc = Misc.getChildByTagName(frame,XMLString.SVG_DESC); if (desc==null) {