Package org.encuestame.business.images

Examples of org.encuestame.business.images.ThumbnailGenerator


    public void generateThumbnails(
            final String fileNamePrefix,
            final InputStream inputStream,
            final String contentType,
            final String thumbnailsLocation) {
        ThumbnailGenerator thumbnailGenerator = thumbnailGenerators.get(contentType);
        thumbnailGenerator = thumbnailGenerator != null ? thumbnailGenerator
                : defaultThumbnailGenerator;
        if (thumbnailGenerator != null) {
            Object hint = null;
            for (int dimension : supportedSizes) {
                File fileOut = new File(thumbnailsLocation, fileNamePrefix + dimension + generatedExtension);
                try {
                    if (log.isDebugEnabled()) {
                        log.debug("Checking user account picture folder "+fileOut.getAbsolutePath());
                        log.debug("Checking user account picture folder "+fileOut.exists());
                    }
                    if (!fileOut.exists()) {
                        log.debug("Creating user account picture folder");
                        fileOut.mkdirs();
                        log.debug("Checking user account picture folder "+fileOut.exists());
                    }
                    hint = thumbnailGenerator.createThumbnail(inputStream,
                            fileOut, dimension, hint);
                    log.debug("Generated thumbnail for: " + inputStream
                            + " in " + fileOut + " for type " + contentType);
                } catch (Exception e) {
                    log.error("Error generating thumbnail for: " + inputStream
View Full Code Here

TOP

Related Classes of org.encuestame.business.images.ThumbnailGenerator

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.