Package org.fluxtream.core.images

Examples of org.fluxtream.core.images.ImageOrientation


            if ((facetTags != null) && (!facetTags.isEmpty())) {
                this.tags.addAll(facetTags);
            }

            // get the image orientation, defaulting to upright portrait
            final ImageOrientation tempOrientation = photoFacetVO.getOrientation();
            this.orientation = (tempOrientation == null ? ImageOrientation.ORIENTATION_1 : tempOrientation).getId();
        }
View Full Code Here


     */
    @Nullable
    public static Image createJpegThumbnail(@Nullable final byte[] imageBytes, final int lengthOfLongestSideInPixels) throws IOException {
        if (imageBytes != null && imageBytes.length > 0 && lengthOfLongestSideInPixels > 0) {

            ImageOrientation orientation = ImageOrientation.getOrientation(new ByteArrayInputStream(imageBytes));
            if (orientation == null) {
                orientation = ImageOrientation.ORIENTATION_1;
            }

            try {
                BufferedImage image = convertToBufferedImage(imageBytes);
                if (image != null) {
                    // drop the alpha channel, if one exists
                    if (image.getColorModel().hasAlpha()) {
                        image = dropAlphaChannel(image);
                    }
                    return JpegImage.create(orientation.transform(Scalr.resize(image, Scalr.Method.AUTOMATIC, Scalr.Mode.AUTOMATIC, lengthOfLongestSideInPixels)));
                }
            }
            catch (Exception e) {
                final String message = "Exception while trying to create a thumbnail";
                LOG.error(message, e);
View Full Code Here

            if ((facetTags != null) && (!facetTags.isEmpty())) {
                this.tags.addAll(facetTags);
            }

            // get the image orientation, defaulting to upright portrait
            final ImageOrientation tempOrientation = photoFacetVO.getOrientation();
            this.orientation = (tempOrientation == null ? ImageOrientation.ORIENTATION_1 : tempOrientation).getId();
        }
View Full Code Here

        thumbnail0Size = new Dimension(thumbnail0Image.getWidth(), thumbnail0Image.getHeight());
        thumbnail1Size = new Dimension(thumbnail1Image.getWidth(), thumbnail1Image.getHeight());
        thumbnail2Size = new Dimension(thumbnail2Image.getWidth(), thumbnail2Image.getHeight());

        // get the image orientation, and default to ORIENTATION_1 if unspecified
        ImageOrientation orientationTemp;
        try {
            orientationTemp = ImageUtils.getOrientation(photoBytes);
        }
        catch (Exception e) {
            logger.error("Exception while trying to read the orientation data for user [" + guestId + "] photo [" + photoStoreKey + "]");
View Full Code Here

TOP

Related Classes of org.fluxtream.core.images.ImageOrientation

Copyright © 2018 www.massapicom. 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.