Package org.fluxtream.core.images

Examples of org.fluxtream.core.images.ImageType


                final ImageInputStream iis = ImageIO.createImageInputStream(new ByteArrayInputStream(imageBytes));
                final Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(iis);
                if (imageReaders != null) {
                    while (imageReaders.hasNext()) {
                        final ImageReader reader = imageReaders.next();
                        final ImageType imageType = ImageType.findByFormatName(reader.getFormatName());
                        if (imageType != null) {
                            return imageType;
                        }
                    }
                }
View Full Code Here


                    @Override
                    public ImageType getImageType() {
                        // Try to read the image type.  If we can't for some reason, then just lie and say it's a JPEG.
                        // This really should never happen, but it's good to check for it anyway and log a warning if it
                        // happens.
                        ImageType imageType = ImageUtils.getImageType(bytes);
                        if (imageType == null) {
                            imageType = ImageType.JPEG;
                            LOG.warn("FluxtreamCapturePhotoStore.getImageType(): Could not determine the media type for photo [" + getIdentifier() + "]!  Defaulting to [" + imageType.getMediaType() + "]");
                        }

                        return imageType;
                    }
                };
View Full Code Here

    private final String comment;

    FluxtreamCapturePhoto(final long guestId, @NotNull final byte[] photoBytes, @NotNull final PhotoUploadMetadata photoUploadMetadata) throws IllegalArgumentException, NoSuchAlgorithmException, IOException, FluxtreamCapturePhotoStore.UnsupportedImageFormatException {

        // Get the image type.  If this is null, then it's not a supported type.
        final ImageType tempImageType = ImageUtils.getImageType(photoBytes);
        if (tempImageType == null) {
            throw new FluxtreamCapturePhotoStore.UnsupportedImageFormatException("The photoBytes do not contain a supported image format");
        }
        imageType = tempImageType;
View Full Code Here

TOP

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

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.