The Image Processor service is an image utility service on the cloud that enables developers to perform various image operations on the uploaded images such as resize, scale, thumbnail, crop etc. This module is very useful for mobile Apps where images need not to be stored locally and processor intensive operations are to be performed. It is also useful for web applications that need to perform complex image operations.
In order to use various functions available in a specific API, a developer has to create an instance of ServiceAPI by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.
Required Parameters
apiKey - The Application key given when the application was created.
secretKey - The secret key corresponding to the application key given when the application was created.
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI *api = [[ServiceAPI alloc]init]; api.apiKey = @"<API_KEY>"; api.secretKey = @"<SECRET_KEY>";ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");Coming SoonNot AvailabeServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");$api = new ServiceAPI("API_KEY","SECRET_KEY");Coming Soonapi = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>")Coming SoonComing Soon
After initialization, developer needs to call the buildXXXService method on ServiceAPI instance to get the instance of the particular API that you wish to build. For example, To build an instance of ImageProcessorService, buildImageProcessorService() method needs to be called.
ImageProcessorService imageProcessorService = api.buildImageProcessorService();ImageProcessorService imageProcessorService = api.BuildImageProcessorService();ImageProcessorService *imageProcessorService = [api buildImageProcessorService];ImageProcessorService imageProcessorService = api.buildImageProcessorService();ImageProcessorService imageProcessorService = api.buildImageProcessorService();Coming SoonNot AvailabeImageProcessorService imageProcessorService = api.BuildImageProcessorService();$imageProcessorService = $api->buildImageProcessorService();Coming Soonimage_processor_service = api.build_image_processor_service()Coming SoonComing Soon
import com.shephertz.app42.paas.sdk.android.ServiceAPI; import com.shephertz.app42.paas.sdk.android.App42Response; import com.shephertz.app42.paas.sdk.android.App42Exception; import com.shephertz.app42.paas.sdk.android.App42BadParameterException; import com.shephertz.app42.paas.sdk.android.App42NotFoundException; import com.shephertz.app42.paas.sdk.android.imageProcessor.Image; import com.shephertz.app42.paas.sdk.android.imageProcessor.ImageProcessorService;using com.shephertz.app42.paas.sdk.windows; using com.shephertz.app42.paas.sdk.windows.imageProcessor;#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"import com.shephertz.app42.paas.sdk.jme.ServiceAPI; import com.shephertz.app42.paas.sdk.jme.App42Response; import com.shephertz.app42.paas.sdk.jme.App42Exception; import com.shephertz.app42.paas.sdk.jme.App42BadParameterException; import com.shephertz.app42.paas.sdk.jme.App42NotFoundException; import com.shephertz.app42.paas.sdk.jme.imageProcessor.Image; import com.shephertz.app42.paas.sdk.jme.imageProcessor.ImageProcessorService;import com.shephertz.app42.paas.sdk.java.ServiceAPI; import com.shephertz.app42.paas.sdk.java.App42Response; import com.shephertz.app42.paas.sdk.java.App42Exception; import com.shephertz.app42.paas.sdk.java.App42BadParameterException; import com.shephertz.app42.paas.sdk.java.App42NotFoundException; import com.shephertz.app42.paas.sdk.java.imageProcessor.Image; import com.shephertz.app42.paas.sdk.java.imageProcessor.ImageProcessorService;Coming SoonNot Availableusing com.shephertz.app42.paas.sdk.csharp; using com.shephertz.app42.paas.sdk.csharp.imageProcessor;use com\shephertz\app42\paas\sdk\php\App42Response; use com\shephertz\app42\paas\sdk\php\App42Exception; use com\shephertz\app42\paas\sdk\php\App42BadParameterException; use com\shephertz\app42\paas\sdk\php\App42NotFoundException; use com\shephertz\app42\paas\sdk\php\imageProcessor\ImageProcessorService; use com\shephertz\app42\paas\sdk\php\ServiceAPI; include_once '../ImageProcessorService.php'; include_once '../ServiceAPI.php'; include_once '../App42Response.php'; include_once '../App42Exception.php'; include_once '../App42BadParameterException.php'; include_once '../App42NotFoundException.php';Coming Soonrequire 'App42_Ruby_API'Coming SoonComing Soon
Resize image. 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.
Required Parameters
imageName - Name of the image to resize.
imagePath - Path of the local file to resize.
width - Width of the image to resize.
height - Height of the image to resize.
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resize(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; Image *image = [imageProcesorService resize:name imagePath:imagePath width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resize(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Image image = imageProcessorService.Resize(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; $image = $imageProcessorService->resize($imageName,$imagePath,$width,$height); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonimage_name = "Resize01'; image_path = "Local file path"; width = "234"; height = "1000"; image = image_processor_service.resize(image_name, image_path, width, height); puts "imageName is #{image.image_name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Creates a thumbnail of the image. 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 hearder 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.
Required Parameters
imageName - Name of the image file for which thumbnail has to be created.
imagePath - Path of the local file whose thumbnail has to be created.
width - Width of the image for thumbnail.
height - Height of the image for thumbnail.
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnail(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; Image *image = [imageProcesorService thumbnail:name imagePath:imagePath width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnail(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Image image = imageProcessorService.Thumbnail(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; $image = $imageProcessorService->thumbnail($imageName,$imagePath,$width,$height); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "Thumbnail1"; image_path = "Local file path"; width = "234"; height = "1000"; image = image_processor_service.thumbnail(name, image_path, width, height); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Scales the image based on width and height. 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
Required Parameters
imageName - Name of the image to scale.
imagePath - Path of the local file to scale.
width - Width of the image to scale.
height - Height of the image to scale.
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scale(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; Image *image = [imageProcesorService scale:name imagePath:imagePath width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scale(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Image image = imageProcessorService.Scale(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; $image = $imageProcessorService->scale($imageName,$imagePath,$width,$height); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "Scale01"; image_path = "Local file path"; width = "234"; height = "1000"; image = image_processor_service.scale(name, image_path, width, height); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Crops image based on width, height and x, y coordinates. 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
Required Parameters
imageName - Name of the image to crop.
imagePath - Path of the local file to crop.
width - Width of the image to crop.
height - Height of the image to crop.
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.crop(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; Image *image = [imageProcesorService crop:name imagePath:imagePath width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.crop(imageName,imagePath,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Image image = imageProcessorService.Crop(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; $image = $imageProcessorService->crop($imageName,$imagePath,$width,$height); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "Crop"; image_path = "Local file path"; width = "234"; height = "1000"; x = "34" ; y = "32" ; image = image_processor_service.crop(name, image_path, width, height, x, y); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
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
Required Parameters
imageName - Name of the image to resize.
imagePath - Path of the local file to resize.
convertFormat - Format in which you need to convert the file.
String imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; Image image = imageProcessorService.convertFormat(imageName,imagePath,convertFormat); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableComing SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; Image image = imageProcessorService.convertFormat(imageName,imagePath,convertFormat); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; Image image = imageProcessorService.ConvertFormat(imageName,imagePath,convertFormat); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $convertFormat = "File Format"; $image = $imageProcessorService->convertFormat($imageName,$imagePath,$convertFormat); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "Convert"; image_path = "Local file path"; format_to_convert = "Format of file to be convert"; image = image_processor_service.convert_format(name, image_path, format_to_convert); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; json_response = image.to_string();Coming SoonComing Soon
Resize image by Percentage. 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
Required Parameters
imageName - Name of the image to resize.
imagePath - Path of the local file to resize.
percentage - Percentage to which image has to be resized.
String imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.resizeByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; Image *image = [imageProcesorService resizeByPercentage:name imagePath:imagePath percentage:percentage]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.resizeByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.ResizeByPercentage(imageName,imagePath,percentage); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; $image = $imageProcessorService->resizeByPercentage($imageName,$imagePath,$percentage); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "ResizeByPercentage02"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.resize_by_percentage(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Creates a thumbnail of the image by Percentage. 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.
Required Parameters
imageName - Name of the image file for which thumbnail has to be created.
imagePath - Path of the local file whose thumbnail has to be created.
percentage - Percentage for thumbnail.
String imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.thumbnailByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; Image *image = [imageProcesorService thumbnailByPercentage:name imagePath:imagePath percentage:percentage]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.thumbnailByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.ThumbnailByPercentage(imageName,imagePath,percentage); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; $image = $imageProcessorService->thumbnailByPercentage($imageName,$imagePath,$percentage); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming Soonname = "ThumbnailByPercentage"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.thumbnail_by_percentage(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "percentage is #{image.percentage}"; json_response = image.to_s();Coming SoonComing Soon
Scales the image by Percentage. 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.
Required Parameters
imageName - Name of the image file to scale.
imagePath - Path of the local file to scale.
percentage - Percentage to which image has to be scaled.
String imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.scaleByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; Image *image = [imageProcesorService scaleByPercentage:name imagePath:imagePath percentage:percentage]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.scaleByPercentage(imageName,imagePath,percentage); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = 100; Image image = imageProcessorService.ScaleByPercentage(imageName,imagePath,percentage); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; $image = $imageProcessorService->scaleByPercentage($imageName,$imagePath,$percentage); print_r("imageName is " . $image->getName()); print_r("convertedImage is " . $image->getConvertedImage()); $jsonResponse = $image->toString();Coming SoonComing SoonComing Soonname = "ScaleByPercentage"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.scale_by_percentage(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "percentage is #{image.percentage}"; json_response = image.to_s();
Required Parameters
imageName - 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.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resize(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.Resize(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService resize:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resize(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resize(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.Resize(imageName,inputStream,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "name'; input_stream = File.open('localPath', 'r'); width = "234"; height = "1000"; image = image_processor_service.resize_stream(name, input_stream, width, height); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
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 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.
Required Parameters
imageName - Name of the image file for which thumbnail has to be created.
inputStream - InputStream of the local file for thumbnail.
width - Width of the image for thumbnail.
height - Height of the image for thumbnail.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnail(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.Thumbnail(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService thumbnail:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnail(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnail(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.Thumbnail(imageName,inputStream,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "Thumbnail1"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; image = image_processor_service.thumbnail_stream(name, image_path, width, height); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Scales the image based on width and height. 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
Required Parameters
imageName - 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.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scale(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.Scale(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService scale:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scale(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scale(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.Scale(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "Scale01"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; image = image_processor_service.scale_stream(name, image_path, width, height); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Crops image based on width, height and x, y coordinates. 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
Required Parameters
imageName - 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.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.crop(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.Crop(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService crop:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.crop(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.crop(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.Crop(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "Crop"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; x = "34" ; y = "32" ; image = image_processor_service.crop_stream(name, image_path, width, height, x, y); puts "imageName is #{image.name}"; puts "originalImage is #{image.originalImage}"; puts "convertedImage is #{image.convertedImage}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Resize image by Percentage. 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
Required Parameters
imageName - Name of the image to resize.
inputStream - InputStream of the local file to resize.
percentage - Percentage to which image has to be resized.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resizeByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.ResizeByPercentage(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService resizeByPercentage:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.resizeByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.ResizeByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.Resize(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "ResizeByPercentage02"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.resize_by_percentage_stream(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "width is #{image.width}"; puts "height is #{image.height}"; json_response = image.to_s();Coming SoonComing Soon
Creates a thumbnail of the image by Percentage. 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.
Required Parameters
imageName - Name of the image file for which thumbnail has to be created.
inputStream - InputStream of the local file for thumbnail.
percentage - Percentage for thumbnail.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnailByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.ThumbnailByPercentage(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService thumbnailByPercentage:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnailByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.thumbnailByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.ThumbnailByPercentage(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "ThumbnailByPercentage"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.thumbnail_by_percentage_stream(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "percentage is #{image.percentage}"; json_response = image.to_s();Coming SoonComing Soon
Scales the image by Percentage. 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.
Required Parameters
imageName - Name of the image file to scale.
inputStream - InputStream of the local file to scale.
percentage - Percentage to which image has to be scaled.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scaleByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.ScaleByPercentage(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService scaleByPercentage:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scaleByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.scaleByPercentage(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.ScaleByPercentage(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "ScaleByPercentage"; image_path = "Local file path"; percentage = "100"; image = image_processor_service.scale_by_percentage_stream(name, image_path, percentage); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; puts "percentage is #{image.percentage}"; json_response = image.to_s();Coming SoonComing Soon
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
Required Parameters
imageName - Name of the image to resize.
inputStream - InputStream of the local file for convert.
convertFormat - Format in which you need to convert the file.
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.convertFormat(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();public class Callback : App42Callback { String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; uploadService.ConvertFormat(imageName,inputStream,width,height,this); void App42Callback.OnException(App42Exception exception) { Console.WriteLine("Exception Message"); } void App42Callback.OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; ImageProcesor *image = [imageProcesorService convertFormat:imageName imageData:imageData width:width height:height]; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); NSString *jsonResponse = [image toString];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.convertFormat(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Image image = imageProcessorService.convertFormat(imageName,inputStream,width,height); System.out.println("imageName is " + image.getName()); System.out.println("convertedImage is " + image.getConvertedImage()); String jsonResponse = image.toString();Coming SoonNot AvailableString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; Image image = imageProcessorService.ConvertFormat(imageName,imagePath,width,height); Console.WriteLine("imageName is " + image.GetName()); Console.WriteLine("convertedImage is " + image.GetConvertedImage()); String jsonResponse = image.ToString();Not AvailableComing Soonname = "Convert"; image_path = "Local file path"; format_to_convert = "Format of file to be convert"; image = image_processor_service.convert_format_with_stream(name, image_path, format_to_convert); puts "imageName is #{image.name}"; puts "originalImage is #{image.original_image}"; puts "convertedImage is #{image.converted_image}"; json_response = image.to_string();Coming SoonComing Soon
The functions available under Image Processor API can throw some exceptions in abnormal conditions. Example of the same has been given below. E.g. If App developer is resizing the image file and storing it with the name which already exist in the database, the function will throw the Exception with message as “Bad Request” and the appErrorCode as “3200” and the details as “The request parameters are invalid. Image with the name ‘@name’ already exists.”.
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = 1000; try { Image image = imageProcessorService.resize(imageName,imagePath, width,height); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }public class Callback : App42Callback { String imageName = "imageName.jpg"; int width = 234; int height = 1000; Stream inputStream = "Stream of file"; imageProcessorService.Resize(imageName,inputStream, width,height, this); void App42Callback.OnException(App42Exception exception) { int appErrorCode = exception.GetAppErrorCode(); int httpErrorCode = exception.GetHttpErrorCode(); if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@imageName' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = exception.GetMessage(); } void App42Callback.OnSuccess(Object object) { Cart cart = (Cart) object; String jsonResponse = cart.ToString(); } }String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; @try { Image *image= [imageProcessorService resize:imageName imagePath:imagePath width:width height:height]; } @catch(App42Exception *ex) { int appErrorCode = ex.appErrorCode; int httpErrorCode = ex.httpErrorCode; if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } NSString *jsonText = ex.reason; }String imageName = "imageName.jpg"; InputStream inputStream = "Stream of file"; Integer width = new Integer(234); Integer height = 1000; try { Image image = imageProcessorService.resize(imageName,inputStream, width,height); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = 1000; try { Image image = imageProcessorService.resize(imageName,imagePath, width,height); } catch(App42Exception ex) { int appErrorCode = ex.getAppErrorCode(); int httpErrorCode = ex.getHttpErrorCode(); if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.getMessage(); }Coming SoonNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; try { Image image = imageProcessorService.Resize(imageName,imagePath, width,height); } catch(App42Exception ex) { int appErrorCode = ex.GetAppErrorCode(); int httpErrorCode = ex.GetHttpErrorCode(); if(appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if(appErrorCode == 1401){ // handle here for Client is not authorized } else if(appErrorCode == 1500){ // handle here for Internal Server Error } String jsonText = ex.GetMessage(); }$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; try { $image = $imageProcessorService->resize($imageName,$imagePath, $width,$height); } catch(App42Exception $ex) { $appErrorCode = $ex->getAppErrorCode(); $httpErrorCode = $ex->getHttpErrorCode(); if($appErrorCode == 3200) { // Handle here for Bad Request (The request parameters are invalid. Image with the name '@name' already exists.) } else if($appErrorCode == 1401){ // handle here for Client is not authorized } else if($appErrorCode == 1500){ // handle here for Internal Server Error } $jsonText = $ex->getMessage(); /* returns the Exception text in JSON format. (as shown below)*/ }Coming SoonComing SoonComing SoonComing Soon
Functions in Image API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):
1400 - BAD REQUEST - The Request parameters are invalid.
1401 - UNAUTHORIZED - Client is not authorized.
1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again.
3200 - BAD REQUEST - The request parameters are invalid. Image with the name '@name' already exists.