Package org.jtalks.jcommune.service.exceptions

Examples of org.jtalks.jcommune.service.exceptions.ImageProcessException


     */
    public String preProcessAndEncodeInString64(byte[] bytes) throws ImageProcessException {
        Validate.notNull(bytes, "Incoming byte array cannot be null");
        BufferedImage image = imageConverter.convertByteArrayToImage(bytes);
        if (image == null) { // something went wrong during conversion
            throw new ImageProcessException();
        }
        byte[] outputImage = imageConverter.preprocessImage(image);
        return base64Wrapper.encodeB64Bytes(outputImage);
    }
View Full Code Here


            }

            baos.flush();
            result = baos.toByteArray();
        } catch (IOException e) {
            throw new ImageProcessException(e);
        } finally {
            IOUtils.closeQuietly(baos);
        }

        return result;
View Full Code Here

                result = ICODecoder.read(bis).get(0);
            } else {
                result = ImageIO.read(bis);
            }
        } catch (IOException | IndexOutOfBoundsException e) {
            throw new ImageProcessException(e);
        } finally {
            IOUtils.closeQuietly(bis);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.service.exceptions.ImageProcessException

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.