/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }