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.
import com.shephertz.app42.paas.sdk.android.App42API; 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.App42API; 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.App42API; 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;using com.shephertz.app42.paas.sdk.csharp; using com.shephertz.app42.paas.sdk.csharp.imageProcessor;Not AvailableComing SoonComing Soonusing com.shephertz.app42.paas.sdk.csharp; using com.shephertz.app42.paas.sdk.csharp.imageProcessor;include_once '../ImageProcessorService.php'; include_once '../App42Response.php'; include_once '../App42Exception.php'; include_once '../App42Log.php'; include_once '../App42BadParameterException.php'; include_once '../App42NotFoundException.php';Coming Soonrequire 'App42_Ruby_API'import com.shephertz.app42.paas.sdk.as3.App42API; import com.shephertz.app42.paas.sdk.as3.App42Response; import com.shephertz.app42.paas.sdk.as3.App42Exception; import com.shephertz.app42.paas.sdk.as3.App42BadParameterException; import com.shephertz.app42.paas.sdk.as3.App42NotFoundException; import com.shephertz.app42.paas.sdk.as3.imageProcessor.Image; import com.shephertz.app42.paas.sdk.as3.imageProcessor.ImageProcessorService;Coming Sooncoming soon
In order to use various the functions available in a specific API, a developer has to initialize with App42API 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.
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");App42API.Initialize("API_KEY","SECRET_KEY");[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];App42API.initialize("API_KEY","SECRET_KEY");App42API.initialize("API_KEY","SECRET_KEY");App42API.Initialize("API_KEY","SECRET_KEY");Not AvailableComing SoonComing SoonApp42API.Initialize("API_KEY","SECRET_KEY");App42API::initialize("API_KEY","SECRET_KEY");Coming Soonapi = App42::ServiceAPI.new("API_KEY","SECRET_KEY")App42API.initialize("API_KEY","SECRET_KEY");Coming Sooncoming soon
After initialization, developer needs to call the buildXXXService method on App42API 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 = App42API.buildImageProcessorService();ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService();ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService];ImageProcessorService imageProcessorService = App42API.buildImageProcessorService();ImageProcessorService imageProcessorService = App42API.buildImageProcessorService();ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService();Not AvailableComing SoonComing SoonImageProcessorService imageProcessorService = App42API.BuildImageProcessorService();$imageProcessorService = App42API::buildImageProcessorService();Coming Soonimage_processor_service = api.build_image_processor_service()var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService();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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.resize(imageName, imagePath, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message " + ex.getMessage()); } });Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService resize:name imagePath:imagePath width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resize(imageName,imagePath,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Resize(imageName, imagePath, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Width : " + image.GetWidth()); App42Log.Console("Height : " + image.GetHeight()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Resize(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->resize($imageName,$imagePath,$width,$height); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Width :".$image->getWidth()); print_r("Height :".$image->getHeight()); $jsonResponse = $image->toString();Coming Soonimage_name = "Resize01"; image_path = "Local file path"; width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var width:int = 234; var height:int =100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.resize(imageName, imagePath, width, height,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Width :"+image.getWidth()); trace("Height :"+image.getHeight()); } }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 header information. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls. Thumbnailing 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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.thumbnail(imageName, imagePath, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message " + ex.getMessage()); } });Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService thumbnail:name imagePath:imagePath width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnail(imageName,imagePath,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Thumbnail(imageName, imagePath, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action :"+image.GetAction()); App42Log.Console("Original Image :"+image.GetOriginalImage()); App42Log.Console("Converted Image :"+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url :"+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url :"+image.GetConvertedImageTinyUrl()); App42Log.Console("Width :"+image.GetWidth()); App42Log.Console("Height :"+image.GetHeight()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Thumbnail(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->thumbnail($imageName,$imagePath,$width,$height); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Width :".$image->getWidth()); print_r("Height :".$image->getHeight()); $jsonResponse = $image->toString();Coming Soonname = "Thumbnail1"; image_path = "Local file path"; width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var width:int = 234; var height:int =100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.thumbnail(imageName, imagePath, width, height,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Width :"+image.getWidth()); trace("Height :"+image.getHeight()); } }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. Scaling 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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.scale(imageName, imagePath, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message " + ex.getMessage()); } });Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService scale:name imagePath:imagePath width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scale(imageName,imagePath,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Scale(imageName, imagePath, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : "+image.GetAction()); App42Log.Console("Original Image : "+image.GetOriginalImage()); App42Log.Console("Converted Image : "+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : "+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : "+image.GetConvertedImageTinyUrl()); App42Log.Console("Width : "+image.GetWidth()); App42Log.Console("Height : "+image.GetHeight()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Scale(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->scale($imageName,$imagePath,$width,$height); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Width :".$image->getWidth()); print_r("Height :".$image->getHeight()); $jsonResponse = $image->toString();Coming Soonname = "Scale01"; image_path = "Local file path"; width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var width:int = 234; var height:int =100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.scale(imageName, imagePath, width, height,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Width :"+image.getWidth()); trace("Height :"+image.getHeight()); } }Coming Sooncoming soon
Crop image based on the 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. Croping is done based on the width, height and the X,Y cordinates 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.
x - Coordinate X
y - Coordinate Y
String imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Integer x = new Integer(34) ; Integer y = new Integer(32) ; App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.crop(imageName, imagePath, width, height, x, y, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image : " + image.getName()); System.out.println("Action : " + image.getAction()); System.out.println("Original Image : " + image.getOriginalImage()); System.out.println("Converted Image : " + image.getConvertedImage()); System.out.println("Original Image Tiny Url : " + image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url : " + image.getConvertedImageTinyUrl()); System.out.println("Width : " + image.getWidth()); System.out.println("Height : " + image.getHeight()); System.out.println("X : " + image.getX()); System.out.println("Y : " + image.getY()); } public void onException(Exception ex) { System.out.println("Exception Message " + ex.getMessage()); } });Not AvailableNSString *name = @"imageName"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; int x = 34; int y = 32; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService crop:name imagePath:imagePath width:width height:height x:x y:y completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Integer width = new Integer(234); Integer height = new Integer(1000); Integer x = new Integer(34) ; Integer y = new Integer(32) ; App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.crop(imageName, imagePath, width, height, x, y); System.out.println("Name Of Image : " + image.getName()); System.out.println("Action : " + image.getAction()); System.out.println("Original Image : " + image.getOriginalImage()); System.out.println("Converted Image : " + image.getConvertedImage()); System.out.println("Original Image Tiny URL : " + image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny URL : " + image.getConvertedImageTinyUrl()); System.out.println("Width : " + image.getWidth()); System.out.println("Height : " + image.getHeight()); System.out.println("X : " + image.getX()); System.out.println("Y : " + image.getY()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; int x = 34 ; int y = 32 ; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Crop(imageName, imagePath, width, height, x, y, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("convertedImage is : " + image.GetConvertedImage()); App42Log.Console("Action : "+image.GetAction()); App42Log.Console("Original Image : "+image.GetOriginalImage()); App42Log.Console("Converted Image : "+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : "+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : "+image.GetConvertedImageTinyUrl()); App42Log.Console("Width : "+image.GetWidth()); App42Log.Console("Height : "+image.GetHeight()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; int x = 34 ; int y = 32 ; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Crop(imageName,imagePath,width,height,x,y); Console.WriteLine("ImageName is : " + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("x is " + image.GetX()); Console.WriteLine("y is " + image.GetY()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $width = 234; $height = 1000; $x = 34 ; $y = 32 ; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->crop($imageName,$imagePath,$width,$height,$x,$y); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Width :".$image->getWidth()); print_r("Height :".$image->getHeight()); print_r("X : " .$image->getX()); print_r("Y : " . $image->getY()); $jsonResponse = $image->toString();Coming Soonname = "Crop"; image_path = "Local file path"; width = "234"; height = "1000"; x = "34" ; y = "32" ; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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 "x is #{image.x}"; puts "y is #{image.y}"; json_response = image.to_s();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var width:int = 234; var height:int =100; var x:int = 34 ; var y:int = 32 ; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.crop(imageName,imagePath,width,height, x, y, new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Width :"+image.getWidth()); trace("Height :"+image.getHeight()); trace("X :"+image.getX()); trace("Y :"+image.getY()); } }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 for conversion.
imagePath - Path of the local file for conversion.
convertFormat - Format in which you need to convert the file.
String imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.convertFormat(imageName, imageName, convertFormat, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });Not AvailableNot AvailableNot AvailableString imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.convertFormat(imageName,imagePath,convertFormat); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ConvertFormat(imageName, imagePath, convertFormat, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ConvertFormat(imageName,imagePath,convertFormat); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $convertFormat = "File Format"; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->convertFormat($imageName,$imagePath,$convertFormat); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); $jsonResponse = $image->toString();Coming Soonname = "Convert"; image_path = "Local file path"; format_to_convert = "Format of file to be convert"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var convertFormat:String = "File Format"; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.convertFormat(imageName,imagePath, convertFormat,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); } }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 percentage 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 = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.resizeByPercentage(imageName, imagePath, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message : " + ex.getMessage()); } });Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService resizeByPercentage:name imagePath:imagePath percentage:percentage completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resizeByPercentage(imageName,imagePath,percentage); System.out.println("Name Of Image : "+image.getName()); System.out.println("Action : "+image.getAction()); System.out.println("Original Image : "+image.getOriginalImage()); System.out.println("Converted Image : "+image.getConvertedImage()); System.out.println("Original Image Tiny Url : "+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url : "+image.getConvertedImageTinyUrl()); System.out.println("Percentage : "+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ResizeByPercentage(imageName, imagePath, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("ImageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ResizeByPercentage(imageName, imagePath, percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.GetPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->resizeByPercentage($imageName,$imagePath,$percentage); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Percentage :".$image->getPercentage()); $jsonResponse = $image->toString();Coming Soonname = "ResizeByPercentage02"; image_path = "Local file path"; percentage = "100"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var percentage:int = 100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.resizeByPercentage(imageName,imagePath,percentage,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Percentage :"+image.getPercentage()); } }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. Thumbnailing is done based on the percentage 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 = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.thumbnailByPercentage(imageName, imagePath, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image : "+image.getName()); System.out.println("Action : "+image.getAction()); System.out.println("Original Image : "+image.getOriginalImage()); System.out.println("Converted Image : "+image.getConvertedImage()); System.out.println("Original Image Tiny Url : "+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url : "+image.getConvertedImageTinyUrl()); System.out.println("Percentage : "+image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message : " + ex.getMessage()); } });Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService thumbnailByPercentage:name imagePath:imagePath percentage:percentage completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnailByPercentage(imageName,imagePath,percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ThumbnailByPercentage(imageName, imagePath, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ThumbnailByPercentage(imageName,imagePath,percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.GetPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->thumbnailByPercentage($imageName,$imagePath,$percentage); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Percentage :".$image->getPercentage()); $jsonResponse = $image->toString();Coming Soonname = "ThumbnailByPercentage"; image_path = "Local file path"; percentage = "100"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();var imageName:String = "imageName"; var imagePath:String = "Your File Path"; var percentage:int = 100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.thumbnailByPercentage(imageName,imagePath,percentage,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Percentage :"+image.getPercentage()); } }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. Scaling is done based on the percentage 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 = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.scaleByPercentage(imageName, imagePath, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message : " + ex.getMessage()); } });Not AvailableNSString *imageName = @"imageName"; NSString *imagePath = @"Your File Path"; double percentage = 100; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService scaleByPercentage:name imagePath:imagePath percentage:percentage completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];Not AvailableString imageName = "imageName"; String imagePath = "Your File Path"; Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scaleByPercentage(imageName,imagePath,percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ScaleByPercentage(imageName, imagePath, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("convertedImage is : " + image.GetConvertedImage()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ScaleByPercentage(imageName,imagePath,percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("ConvertedImage is : " + image.GetConvertedImage()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.GetPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());$imageName = "imageName"; $imagePath = "Your File Path"; $percentage = 100; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); $image = $imageProcessorService->scaleByPercentage($imageName,$imagePath,$percentage); print_r("Name Of Image :".$image->getName()); print_r("Action :".$image->getAction()); print_r("Original Image :".$image->getOriginalImage()); print_r("Converted Image :".$image->getConvertedImage()); print_r("Original Image Tiny Url :".$image->getOriginalImageTinyUrl()); print_r("Converted Image Tiny Url :".$image->getConvertedImageTinyUrl()); print_r("Percentage :".$image->getPercentage()); $jsonResponse = $image->toString();Coming SoonComing Soonvar imageName:String = "imageName"; var imagePath:String = "Your File Path"; var percentage:int = 100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.scaleByPercentage(imageName,imagePath,percentage,new callback()); class callback implements App42CallBack { public function onException(exception:App42Exception):void { trace("Exception Message " + exception); } public function onSuccess(response:Object):void { trace("response is:"+response) var image:Image = Image(response); trace("Name Of Image :"+image.getName()); trace("Action :"+image.getAction()); trace("Original Image :"+image.getOriginalImage()); trace("Converted Image :"+image.getConvertedImage()); trace("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); trace("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); trace("Percentage :"+image.getPercentage()); } }coming sooncoming soon
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.
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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.resize(imageName, inputStream, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.Resize(imageName,inputStream,width,height,new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService resize:imageName imageData:imageData width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resize(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); 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); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resize(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Resize(imageName, stream, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Width : " + image.GetWidth()); App42Log.Console("Height : " + image.GetHeight()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Resize(imageName,inputStream,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "name'; input_stream = File.open('localPath', 'r'); /* Get input stream from your source */ width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing 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 in the cloud and can be accessed through the urls. Thumbnailing 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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.thumbnail(imageName, inputStream, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.Thumbnail(imageName,inputStream,width,height,new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService thumbnail:imageName imageData:imageData width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnail(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); 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); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnail(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Thumbnail(imageName, stream, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action :"+image.GetAction()); App42Log.Console("Original Image :"+image.GetOriginalImage()); App42Log.Console("Converted Image :"+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url :"+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url :"+image.GetConvertedImageTinyUrl()); App42Log.Console("Width :"+image.GetWidth()); App42Log.Console("Height :"+image.GetHeight()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Thumbnail(imageName,inputStream,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("ConvertedImage is : " + image.GetConvertedImage()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "Thumbnail1"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing Sooncoming soon
Scales the image via Stream based on the width, height. Returns the original image url and converted image url. Images are stored in the cloud and can be accessed through the urls. Scaling 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); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.scale(imageName, inputStream, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.Scale(imageName,inputStream,width,height,new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService scale:imageName imageData:imageData width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scale(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); 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); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scale(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Scale(imageName, stream, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : "+image.GetAction()); App42Log.Console("Original Image : "+image.GetOriginalImage()); App42Log.Console("Converted Image : "+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : "+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : "+image.GetConvertedImageTinyUrl()); App42Log.Console("Width : "+image.GetWidth()); App42Log.Console("Height : "+image.GetHeight()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Scale(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "Scale01"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing Sooncoming soon
Crop image via Stream based on the 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. Croping is done based on the width, height and X,Y cordinates 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.
x - Coordinate X
y - Coordinate Y
String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); int x = 34; int y = 32; App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.crop(imageName, inputStream, width, height, x, y, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); System.out.println("X :"+image.getX()); System.out.println("Y :"+image.getY()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; int x = 34 ; int y = 32 ; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.Crop(imageName, inputStream, width, height, x, y, new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("X : " + image.GetX()); Console.WriteLine("Y : " + image.GetY()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; int x = 34; int y = 32; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService crop:imageName imageData:imageData width:width height:height x:x y:y completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); Integer x = new Integer(34); Integer y = new Integer(32); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.crop(imageName,inputStream,width,height, x, y); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); System.out.println("X :"+image.getX()); System.out.println("Y :"+image.getY()); 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); Integer x = new Integer(34); Integer y = new Integer(32); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.crop(imageName,inputStream,width,height, x, y); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Width :"+image.getWidth()); System.out.println("Height :"+image.getHeight()); System.out.println("X :"+image.getX()); System.out.println("Y :"+image.getY()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; int x = 34 ; int y = 32 ; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Crop(imageName, stream, width, height, x, y, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("convertedImage is : " + image.GetConvertedImage()); App42Log.Console("Action : "+image.GetAction()); App42Log.Console("Original Image : "+image.GetOriginalImage()); App42Log.Console("Converted Image : "+image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : "+image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : "+image.GetConvertedImageTinyUrl()); App42Log.Console("Width : "+image.GetWidth()); App42Log.Console("Height : "+image.GetHeight()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.Crop(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Width : " + image.GetWidth()); Console.WriteLine("Height : " + image.GetHeight()); Console.WriteLine("X : " + image.GetX()); Console.WriteLine("Y : " + image.GetY()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "Crop"; image_path = File.open('localPath', 'r'); width = "234"; height = "1000"; x = "34" ; y = "32" ; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing 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 percentage 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 */ Double percentage = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.resizeByPercentage(imageName, inputStream, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image : " + image.getName()); System.out.println("Action :" + image.getAction()); System.out.println("Original Image : " + .getOriginalImage()); System.out.println("Converted Image : " + image.getConvertedImage()); System.out.println("Original Image Tiny Url : " + image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url : " + image.getConvertedImageTinyUrl()); System.out.println("Percentage : " + image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 50; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.ResizeByPercentage(imageName, inputStream, percentage, new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : "+ image.GetPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; double percentage = 50; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService resizeByPercentage:imageName imageData:imageData percentage:percentage completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Double percentage = new Double(50); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resizeByPercentage(imageName, inputStream, percentage); System.out.println("Name Of Image : " + image.getName()); System.out.println("Action :" + image.getAction()); System.out.println("Original Image : " + .getOriginalImage()); System.out.println("Converted Image : " + image.getConvertedImage()); System.out.println("Original Image Tiny Url : " + image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url : " + image.getConvertedImageTinyUrl()); System.out.println("Percentage : " + image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Double percentage = new Double(50); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.resizeByPercentage(imageName,inputStream,percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage : " + image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ResizeByPercentage(imageName, stream, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("ImageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 50; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ResizeByPercentage(imageName, imagePath, percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.GetPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "ResizeByPercentage02"; image_path = "Local file path"; percentage = "100"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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}"; json_response = image.to_s();Not AvailableComing Sooncoming soon
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. Thumbnailing is done based on the percentage 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 */ Double percentage = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.thumbnailByPercentage(imageName, inputStream, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.ThumbnailByPercentage(imageName, inputStream, percentage, new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.getPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; double percentage = 100; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService thumbnailByPercentage:imageName imageData:imageData percentage:percentage completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnailByPercentage(imageName, inputStream, percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.thumbnailByPercentage(imageName, inputStream, percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ThumbnailByPercentage(imageName, stream, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ThumbnailByPercentage(imageName,imagePath,percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.getPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "ThumbnailByPercentage"; image_path = "Local file path"; percentage = "100"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing Sooncoming soon
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. Scaleing is done based on the percentage 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 */ Double percentage = new Double(100); App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.scaleByPercentage(imageName, inputStream, percentage, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 100; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.ScaleByPercentage(imageName, inputStream, percentage, new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.getPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }NSString *imageName = @"imageName.ext"; NSString *imagePath = @"Your File Path"; int width = 234; int height = 1000; NSData *imageData = [NSData dataWithContentsOfFile:[NSURL fileURLWithPath:imagePath]]; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcesorService scaleByPercentage:imageName imageData:imageData width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { NSLog(@"Exception = %@",[exception reason]); NSLog(@"HTTP error Code = %d",[exception httpErrorCode]); NSLog(@"App Error Code = %d",[exception appErrorCode]); NSLog(@"User Info = %@",[exception userInfo]); } }];String imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scaleByPercentage(imageName, inputStream, percentage); 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 */ Double percentage = new Double(100); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.scaleByPercentage(imageName,inputStream,percentage); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); System.out.println("Percentage :"+image.getPercentage()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; double percentage = 100; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ScaleByPercentage(imageName, stream, percentage, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("convertedImage is : " + image.GetConvertedImage()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("Percentage : " + image.GetPercentage()); App42Log.Console("jsonResponse is : " + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ double percentage = 50; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ScaleByPercentage(imageName,imagePath,percentage); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("Percentage : " + image.getPercentage()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "ScaleByPercentage"; image_path = "Local file path"; percentage = "100"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing Sooncoming soon
Converts the format of the image via stream. Returns the original image url and converted image url. Images are stored in 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 */ String convertFormat = "File Format"; App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesorService.convertFormat(imageName, inputStream, convertFormat, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); } public void onException(Exception ex) { System.out.println("Exception Message"+ex.getMessage()); } });String imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); uploadService.ConvertFormat(imageName,inputStream,width,height,new Callback()); public class Callback : App42Callback { public void OnException(App42Exception exception) { Console.WriteLine("Exception Message : " + exception); } public void OnSuccess(Object response) { Image image = (Image) response; Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("jsonResponse is : " + image.ToString()); } }Not AvailableString imageName = "imageName.ext"; InputStream inputStream = null; /* Get input stream from your source */ Integer width = new Integer(234); Integer height = new Integer(1000); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.convertFormat(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); 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); App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); Image image = imageProcessorService.convertFormat(imageName,inputStream,width,height); System.out.println("Name Of Image :"+image.getName()); System.out.println("Action :"+image.getAction()); System.out.println("Original Image :"+image.getOriginalImage()); System.out.println("Converted Image :"+image.getConvertedImage()); System.out.println("Original Image Tiny Url :"+image.getOriginalImageTinyUrl()); System.out.println("Converted Image Tiny Url :"+image.getConvertedImageTinyUrl()); String jsonResponse = image.toString();String imageName = "imageName"; String imagePath = "Your File Path"; String convertFormat = "File Format"; Stream stream = new FileStream(imagePath, FileMode.Open); App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.ConvertFormat(imageName, stream, convertFormat, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnSuccess(object response) { Image image = (Image) response; App42Log.Console("imageName is :" + image.GetName()); App42Log.Console("Action : " + image.GetAction()); App42Log.Console("Original Image : " + image.GetOriginalImage()); App42Log.Console("Converted Image : " + image.GetConvertedImage()); App42Log.Console("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); App42Log.Console("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); App42Log.Console("jsonResponse is :" + image.ToString()); } public void OnException(Exception e) { App42Log.Console("Exception : " + e); } }Not AvailableComing SoonComing SoonString imageName = "imageName.ext"; Stream inputStream = null; /* Get input stream from your source */ int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); Image image = imageProcessorService.ConvertFormat(imageName,imagePath,width,height); Console.WriteLine("ImageName is :" + image.GetName()); Console.WriteLine("Action : " + image.GetAction()); Console.WriteLine("Original Image : " + image.GetOriginalImage()); Console.WriteLine("Converted Image : " + image.GetConvertedImage()); Console.WriteLine("Original Image Tiny Url : " + image.GetOriginalImageTinyUrl()); Console.WriteLine("Converted Image Tiny Url : " + image.GetConvertedImageTinyUrl()); Console.WriteLine("jsonResponse is : " + image.ToString());Not AvailableComing Soonname = "Convert"; image_path = "Local file path"; format_to_convert = "Format of file to be convert"; api = App42::ServiceAPI.new("API_KEY","SECRET_KEY") image_processor_service = api.build_image_processor_service() 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();Not AvailableComing Sooncoming soon
The functions available under Image Processor API can throw some exceptions in abnormal conditions.An example of the same has been given below. E.g. If an 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 a 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; App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); imageProcesor.resize(imageName, imagePath, width, height, new App42CallBack() { public void onSuccess(Object response) { Image image = (Image)response; String jsonResponse = image.toString(); } public void onException(Exception ex) { App42Exception exception = (App42Exception)ex; 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 '@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.jpg"; int width = 234; int height = 1000; Stream inputStream = "Stream of file"; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Resize(imageName,inputStream, width,height, new Callback()); public class Callback : App42Callback { public void 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(); } public void OnSuccess(Object response) { Image image = (Image) response; String jsonResponse = image.ToString(); } }String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; [App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"]; ImageProcessorService *imageProcessorService = [App42API buildImageProcessorService]; [imageProcessorService resize:imageName imagePath:imagePath width:width height:height completionBlock:^(BOOL success, id responseObj, App42Exception *exception) { if (success) { Image *image = (Image*)responseObj; NSLog(@"imageName is = %@",image.name); NSLog(@"convertedImage is = %@",image.convertedImage); } else { 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; App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); 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; App42API.initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.buildImageProcessorService(); 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(); }String imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42Log.SetDebug(true); //Prints output in your editor console App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); imageProcessorService.Resize(imageName, imagePath, width, height, new UnityCallBack()); public class UnityCallBack : App42CallBack { public void OnException(Exception e) { App42Exception ex = (App42Exception)e; 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 void OnSuccess(object response) { App42Log.Console("Response is :" + response.ToString()); } }Not AvailableComing SoonComing SoonString imageName = "imageName"; String imagePath = "Your File Path"; int width = 234; int height = 1000; App42API.Initialize("API_KEY","SECRET_KEY"); ImageProcessorService imageProcessorService = App42API.BuildImageProcessorService(); 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; App42API::initialize("API_KEY","SECRET_KEY"); $imageProcessorService = App42API::buildImageProcessorService(); 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 Soonvar imageName:String = "imageName"; var imagePath:String = "Your File Path"; var width:int = 234; var height:int =100; App42API.initialize("API_KEY","SECRET_KEY"); var imageProcessorService:ImageProcessorService = App42API.buildImageProcessorService(); imageProcessorService.resize(imageName, imagePath, width, height,new callback()); public class callback implements App42CallBack { public function onSuccess(response:Object):void { var image:Image = Image(response); trace("Response is " + image) } public function onException(exception:App42Exception):void { var appErrorCode:int = exception.getAppErrorCode(); var httpErrorCode:int = exception.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 } } }Coming 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.