com.shephertz.app42.paas.sdk.jme.imageProcessor
Class ImageProcessorService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.jme.imageProcessor.ImageProcessorService

public class ImageProcessorService
extends java.lang.Object

The ImageProcessor service is a Image utility service on the Cloud. Developers can upload files on the cloud and perform various Image Manipulation operations on the Uploaded Images e.g. resize, scale, thumbnail, crop etc. It is especially useful for Mobile Apps when they dont want to store Images locally and dont want to perform processor intensive operations. It is also useful for web applications who want to perform complex Image Operations

See Also:
Image

Constructor Summary
ImageProcessorService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
           
 
Method Summary
 Image convertFormat(java.lang.String name, java.io.InputStream imageIS, java.lang.String formatToConvert)
          Converts the format of the image.
 Image crop(java.lang.String name, java.io.InputStream imageIS, java.lang.Integer width, java.lang.Integer height, java.lang.Integer x, java.lang.Integer y)
          Crops image based on width, height and x, y coordinates via Stream.
 Image resize(java.lang.String name, java.io.InputStream imageIS, java.lang.Integer width, java.lang.Integer height)
          Resize image via Stream.
 Image resizeByPercentage(java.lang.String name, java.io.InputStream imageIS, java.lang.Double percentage)
          Resize image by Percentage via Stream.
 Image scale(java.lang.String name, java.io.InputStream imageIS, java.lang.Integer width, java.lang.Integer height)
          Scales the image based on width and height via Stream.
 Image scaleByPercentage(java.lang.String name, java.io.InputStream imageIS, java.lang.Double percentage)
          Scales the image by Percentage via Stream.
 Image thumbnail(java.lang.String name, java.io.InputStream imageIS, java.lang.Integer width, java.lang.Integer height)
          Creates a thumbnail of the image via Stream.
 Image thumbnailByPercentage(java.lang.String name, java.io.InputStream imageIS, java.lang.Double percentage)
          Creates a thumbnail of the image by Percentage via Stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageProcessorService

public ImageProcessorService(java.lang.String apiKey,
                             java.lang.String secretKey,
                             java.lang.String baseURL)
Method Detail

convertFormat

public Image convertFormat(java.lang.String name,
                           java.io.InputStream imageIS,
                           java.lang.String formatToConvert)
                    throws App42Exception
Converts the format of the image. Returns the original image url and converted image url. Images are stored on the cloud and can be accessed through the urls Conversion is done based on the formatToConvert provided

Parameters:
name - - Name of the image to convert
inputStream - - InputStream of the local file to convert
formatToConvert - - to which file needs to be converted
Returns:
Image object containing urls for the original and converted images
Throws:
App42Exception

crop

public Image crop(java.lang.String name,
                  java.io.InputStream imageIS,
                  java.lang.Integer width,
                  java.lang.Integer height,
                  java.lang.Integer x,
                  java.lang.Integer y)
           throws App42Exception
Crops image based on width, height and x, y coordinates via Stream. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image to crop
inputStream - - InputStream of the local file to crop
width - - Width of the image to crop
height - - Height of the image to crop
x - - Coordinate X
y - - Coordinate Y
Throws:
App42Exception

resize

public Image resize(java.lang.String name,
                    java.io.InputStream imageIS,
                    java.lang.Integer width,
                    java.lang.Integer height)
             throws App42Exception
Resize image via Stream. Returns the original image url and converted image url. Images are stored on the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image to resize
inputStream - - InputStream of the local file to resize
width - - Width of the image to resize
height - - Height of the image to resize
Throws:
App42Exception

resizeByPercentage

public Image resizeByPercentage(java.lang.String name,
                                java.io.InputStream imageIS,
                                java.lang.Double percentage)
                         throws App42Exception
Resize image by Percentage via Stream. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image to resize
inputStream - - InputStream of the local file to resize
percentage - - Percentage to which image has to be resized
Throws:
App42Exception

scale

public Image scale(java.lang.String name,
                   java.io.InputStream imageIS,
                   java.lang.Integer width,
                   java.lang.Integer height)
            throws App42Exception
Scales the image based on width and height via Stream. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image to scale
inputStream - - InputStream of the local file to scale
width - - Width of the image to scale
height - - Height of the image to scale
Throws:
App42Exception

scaleByPercentage

public Image scaleByPercentage(java.lang.String name,
                               java.io.InputStream imageIS,
                               java.lang.Double percentage)
                        throws App42Exception
Scales the image by Percentage via Stream. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image file to scale
inputStream - - InputStream of the local file to scale
percentage - - Percentage to which image has to be scaled
Throws:
App42Exception

thumbnail

public Image thumbnail(java.lang.String name,
                       java.io.InputStream imageIS,
                       java.lang.Integer width,
                       java.lang.Integer height)
                throws App42Exception
Creates a thumbnail of the image via Stream. There is a difference between thumbnail and resize The thumbnail operation is optimized for speed, it removes information of the image which is not necessary for a thumbnail e.g header information. Returns the original image url and converted image url. Images are stored on the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image file for which thumbnail has to be created
inputStream - - InputStream of the local file whose thumbnail has to be created
width - - Width of the image for thumbnail
height - - Height of the image for thumbnail
Throws:
App42Exception

thumbnailByPercentage

public Image thumbnailByPercentage(java.lang.String name,
                                   java.io.InputStream imageIS,
                                   java.lang.Double percentage)
                            throws App42Exception
Creates a thumbnail of the image by Percentage via Stream. There is a difference between thumbnail and resize The thumbnail operation is optimized for speed removes information of the image which is not necessary for a thumbnail to reduce size e.g header information. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls Resizing is done based on the width and height provided

Parameters:
name - - Name of the image file for which thumbnail has to be created
inputStream - - InputStream of the local file whose thumbnail has to be created
percentage - - Percentage for thumbnail
Throws:
App42Exception