/** * Return the dimension of this image * * @param part the package part holding raw picture data * @param type type of the picture: {@link Workbook#PICTURE_TYPE_JPEG}, * {@link Workbook#PICTURE_TYPE_PNG} or {@link Workbook#PICTURE_TYPE_DIB} * * @return image dimension in pixels */ protected static Dimension getImageDimension(PackagePart part, int type){ try { return ImageUtils.getImageDimension(part.getInputStream(), type); } catch (IOException e){ //return a "singulariry" if ImageIO failed to read the image logger.log(POILogger.WARN, e); return new Dimension(); } }
/** * Return the dimension of this image * * @param part the package part holding raw picture data * @param type type of the picture: {@link Workbook#PICTURE_TYPE_JPEG}, * {@link Workbook#PICTURE_TYPE_PNG} or {@link Workbook#PICTURE_TYPE_DIB} * * @return image dimension in pixels */ protected static Dimension getImageDimension(PackagePart part, int type){ try { return ImageUtils.getImageDimension(part.getInputStream(), type); } catch (IOException e){ //return a "singulariry" if ImageIO failed to read the image logger.log(POILogger.WARN, e); return new Dimension(); } }
/** * Return the dimension of the embedded image in pixel * * @return image dimension in pixels */ @Override public Dimension getImageDimension(){ InternalWorkbook iwb = getPatriarch().getSheet().getWorkbook().getWorkbook(); EscherBSERecord bse = iwb.getBSERecord(getPictureIndex()); byte[] data = bse.getBlipRecord().getPicturedata(); int type = bse.getBlipTypeWin32(); return ImageUtils.getImageDimension(new ByteArrayInputStream(data), type); }
Dimension imgSize = getImageDimension(new ByteArrayInputStream(data.getData()), data.getPictureType());
/** * Return the dimension of this image * * @param part the package part holding raw picture data * @param type type of the picture: {@link Workbook#PICTURE_TYPE_JPEG}, * {@link Workbook#PICTURE_TYPE_PNG} or {@link Workbook#PICTURE_TYPE_DIB} * * @return image dimension in pixels */ protected static Dimension getImageDimension(PackagePart part, int type){ try { return ImageUtils.getImageDimension(part.getInputStream(), type); } catch (IOException e){ //return a "singulariry" if ImageIO failed to read the image logger.log(POILogger.WARN, e); return new Dimension(); } }
/** * Return the dimension of this image * * @param part the package part holding raw picture data * @param type type of the picture: {@link Workbook#PICTURE_TYPE_JPEG}, * {@link Workbook#PICTURE_TYPE_PNG} or {@link Workbook#PICTURE_TYPE_DIB} * * @return image dimension in pixels */ protected static Dimension getImageDimension(PackagePart part, int type){ try { return ImageUtils.getImageDimension(part.getInputStream(), type); } catch (IOException e){ //return a "singulariry" if ImageIO failed to read the image logger.log(POILogger.WARN, e); return new Dimension(); } }
/** * Return the dimension of this image * * @param part the package part holding raw picture data * @param type type of the picture: {@link Workbook#PICTURE_TYPE_JPEG}, * {@link Workbook#PICTURE_TYPE_PNG} or {@link Workbook#PICTURE_TYPE_DIB} * * @return image dimension in pixels */ protected static Dimension getImageDimension(PackagePart part, int type){ try { return ImageUtils.getImageDimension(part.getInputStream(), type); } catch (IOException e){ //return a "singulariry" if ImageIO failed to read the image logger.log(POILogger.WARN, e); return new Dimension(); } }
/** * Return the dimension of this image * * @return image dimension */ public Dimension getImageDimension(){ EscherBSERecord bse = _patriarch._sheet._book.getBSERecord(_pictureIndex); byte[] data = bse.getBlipRecord().getPicturedata(); int type = bse.getBlipTypeWin32(); return ImageUtils.getImageDimension(new ByteArrayInputStream(data), type); }
/** * Return the dimension of this image * * @return image dimension */ public Dimension getImageDimension(){ EscherBSERecord bse = getPatriarch().getSheet()._book.getBSERecord(getPictureIndex()); byte[] data = bse.getBlipRecord().getPicturedata(); int type = bse.getBlipTypeWin32(); return ImageUtils.getImageDimension(new ByteArrayInputStream(data), type); }
/** * Return the dimension of the embedded image in pixel * * @return image dimension in pixels */ @Override public Dimension getImageDimension(){ InternalWorkbook iwb = getPatriarch().getSheet().getWorkbook().getWorkbook(); EscherBSERecord bse = iwb.getBSERecord(getPictureIndex()); byte[] data = bse.getBlipRecord().getPicturedata(); int type = bse.getBlipTypeWin32(); return ImageUtils.getImageDimension(new ByteArrayInputStream(data), type); }
Dimension imgSize = getImageDimension(new ByteArrayInputStream(data.getData()), data.getPictureType());