Package org.apache.xmlgraphics.image.loader

Examples of org.apache.xmlgraphics.image.loader.ImageSize.calcSizeFromPixels()


                            UnitConv.in2mm(yRes) / 10); //Centimeters
                }
            } else {
                size.setResolution(context.getSourceResolution());
            }
            size.calcSizeFromPixels();
            if (log.isTraceEnabled()) {
                log.trace("TIFF image detected: " + size);
            }

            info = new ImageInfo(uri, MimeConstants.MIME_TIFF);
View Full Code Here


            if (yResDPI == 0) {
                yResDPI = context.getSourceResolution();
            }

            size.setResolution(xResDPI, yResDPI);
            size.calcSizeFromPixels();
            return size;
        } finally {
            in.setByteOrder(oldByteOrder);
            in.reset();
        }
View Full Code Here

                    } else {
                        //resolution not specified
                        size.setResolution(context.getSourceResolution());
                    }
                    if (size.getWidthPx() != 0) {
                        size.calcSizeFromPixels();
                        return size;
                    }
                    in.skipBytes(reclen - 14);
                    break;
                case SOF0:
View Full Code Here

                    in.skipBytes(1);
                    int height = in.readUnsignedShort();
                    int width = in.readUnsignedShort();
                    size.setSizeInPixels(width, height);
                    if (size.getDpiHorizontal() != 0) {
                        size.calcSizeFromPixels();
                        return size;
                    }
                    in.skipBytes(reclen - 7);
                    break;
                case SOS:
View Full Code Here

                case SOS:
                case EOI:
                    //Break as early as possible (we don't want to read the whole file here)
                    if (size.getDpiHorizontal() == 0) {
                        size.setResolution(context.getSourceResolution());
                        size.calcSizeFromPixels();
                    }
                    return size;
                default:
                    jpeg.skipCurrentMarkerSegment();
                }
View Full Code Here

        byte1 = header[8] & 0xff;
        byte2 = header[9] & 0xff;
        int height = ((byte2 << 8) | byte1) & 0xffff;
        ImageSize size = new ImageSize(width, height, context.getSourceResolution());
        size.calcSizeFromPixels();
        return size;
    }

}
View Full Code Here

            //Watch out for a special case: a TGA image was erroneously identified
            //as a WBMP image by a Sun ImageIO codec.
            return null;
        }
        if (size.getWidthMpt() == 0) {
            size.calcSizeFromPixels();
        }

        ImageInfo info = new ImageInfo(uri, mime);
        info.getCustomObjects().put(ImageIOUtil.IMAGEIO_METADATA, iiometa);
        info.setSize(size);
View Full Code Here

                ImageInfo info = new ImageInfo(uri, "image/x-wmf");
                ImageSize size = new ImageSize();
                size.setSizeInPixels(width, height);
                size.setResolution(dpi);
                size.calcSizeFromPixels();
                info.setSize(size);
                ImageWMF img = new ImageWMF(info, wmfStore);
                info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, img);

                return info;
View Full Code Here

                ImageInfo info = new ImageInfo(uri, "image/x-wmf");
                ImageSize size = new ImageSize();
                size.setSizeInPixels(width, height);
                size.setResolution(dpi);
                size.calcSizeFromPixels();
                info.setSize(size);
                ImageWMF img = new ImageWMF(info, wmfStore);
                info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, img);

                return info;
View Full Code Here

        blip.setCstate(STBlipCompression.PRINT);
        blipProps.setBlip(blip);
        pic.setBlipFill(blipProps);
        CTShapeProperties sppr = new CTShapeProperties();
        ImageSize imageSize = new ImageSize(image.width, image.height, 96);//todo this doesn't work unfortunately
        imageSize.calcSizeFromPixels();
        CTPoint2D off = new CTPoint2D();
        off.setX(0);
        off.setY(0);
        CTPositiveSize2D ext = new CTPositiveSize2D();
        ext.setCx(imageSize.getWidthMpt());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.