Welcome to the Lobeo Module Server project. Please feel free to submit bugs related to it.
FS#662 - [Core] Add an api to scale images
Attached to Project:
LMS
Opened by Ferdinand (PaGaisu) - Friday, 06 September 2013, 13:35 GMT
Last edited by Ferdinand (PaGaisu) - Tuesday, 24 September 2013, 16:56 GMT
Opened by Ferdinand (PaGaisu) - Friday, 06 September 2013, 13:35 GMT
Last edited by Ferdinand (PaGaisu) - Tuesday, 24 September 2013, 16:56 GMT
|
DetailsAdd an api to scale images
scaleImage(inputURL,desiredWidth,desiredHeight,outputPath) |
This task depends upon
var testDS = new DataSource(datasourceService,"Test");
var images = testDS.getImages();
for(var i in images){
print(images[i]);
}
var scaledImgFile = new File("scaledImg.jpg");
var image = new Image("http://127.0.0.1/MasterServer/get/Orion/admin@lobeo.com/ws/res/HttpServer/ds-1378821741125/Test/eiffel-tower.jpg");
image.scale(100,100,scaledImgFile);
context.ungetService("com.lobeo.lms.core.service.DataSourceService");
require('com.lobeo.lms.script.api.Image');
require('com.lobeo.lms.script.api.File');
resize(int targetWidth, int targetHeight, File output);
resize(int targetWidth, int targetHeight, File output, boolean keepProportion);
resize(int targetWidth, int targetHeight, File output, Object callbackFunction);
resize(int targetWidth, int targetHeight, File output, boolean keepProportion, Object callbackPointer);
resize(int targetWidth, int targetHeight, File output, boolean keepProportion, Object callbackPointer, boolean highQuality);
callback function example:
function callBack(resizedImage){
print(resizedImage);
}