LMS

Welcome to the Lobeo Module Server project. Please feel free to submit bugs related to it.
Tasklist

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
Task Type Feature Request
Category
Status Closed
Assigned To Ferdinand (PaGaisu)
Operating System All
Severity Low
Priority Normal
Reported Version alpha6
Due in Version alpha7
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Add an api to scale images
scaleImage(inputURL,desiredWidth,desiredHeight,outputPath)
This task depends upon

Closed by  Ferdinand (PaGaisu)
Tuesday, 24 September 2013, 16:56 GMT
Reason for closing:  Implemented
Comment by Ferdinand (PaGaisu) - Tuesday, 10 September 2013, 14:34 GMT
var datasourceService = context.getService("com.lobeo.lms.core.service.DataSourceService");

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");
Comment by Ferdinand (PaGaisu) - Wednesday, 11 September 2013, 09:18 GMT
require('com.lobeo.lms.script.api.DataSource');
require('com.lobeo.lms.script.api.Image');
require('com.lobeo.lms.script.api.File');
Comment by Ferdinand (PaGaisu) - Tuesday, 24 September 2013, 15:31 GMT
scale has been replace by resize

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);
}

Loading...