Page 1 of 1

(JavaScript API) LONGRANGE.Camera Image Dimensions

Posted: Fri Jan 08, 2016 7:32 am
by edwardtn
I am trying to define the resulting size of an image using the code below:

Code: Select all

var opts = {};
opts.enableVideo = false;
opts.saveToPhotoGallery = false;
opts.enableAnnotation = true;
opts.size = { width: "640", height: "480" };
I searched the forum and found a link to a page illustrating how to set the dimensions for a portrait vs. landscape image.

http://www.longrangemobile.com/docs/lrp ... /image.htm

Can this also be done through the LONGRANGE.Camera JavaScript API? Is there a way to specify .LD/.PT?

Re: (JavaScript API) LONGRANGE.Camera Image Dimensions

Posted: Fri Jan 08, 2016 8:59 am
by tsupartono
Hi Edward,
Yes you can specify the landscape/portrait image dimension when using the JavaScript API.

The size.width and size.height properties have sub-properties "portrait" and "landscape".
You can specify both portrait and landscape value, or just either one (portrait or landscape, in which case the value of the other orientation will be derived).

Code: Select all

opts.size = { width: {landscape: "640"}, height: {landscape: "480"} };
The code above indicates that images should be resized to 640x480 when they are in landscape, and 480x640 when in portrait

The code below indicates that images should be resized to 300x200 for landscape, and 150x250 for portrait:

Code: Select all

opts.size = { width: {landscape: "300", portrait: "150"}, height: {landscape: "200", portrait: "250"} };
I'll also send you an updated JavaScript API guide that contains these properties.

Re: (JavaScript API) LONGRANGE.Camera Image Dimensions

Posted: Fri Jan 08, 2016 9:16 am
by edwardtn
Thank you. I received your email. This works perfectly.

Regards,

Edward