#1 2016-12-06 17:31:35

fakie
Banned
Registered: 2016-10-28
Posts: 36

Some rare issue with the Cordova Camera Image Size

Hello there David.

I'm still playing with the AppBuilder. Currently on version 2016.224

------------------
In my "Take a Picture" button, I have
------------------
If "[camImgSize]" "==" "0"
   AlertBox "camImgSize is zero" "info"
EndIf
Show "CamSpin"
// Just do it!
//SetVar "[Camera1.Quality]" "[Range1.Value]" "String"
//Source can be photolibrary or camera
SetVar "[Camera1.Source]" "camera" "String"
SetVar "[Camera1.Quality]" "[camImgQuality]" "String"
SetVar "[Camera1.Corrected]" "true" "String"
SetVar "[Camera1.TargetWidth]" "1024" "Number"
CameraGetPicture "Camera1"

------------------
Then after the image is taken... (in my camera1 success code)
------------------
Hide "CamSpin"
SubStr "[Camera1.Data]" "1" "20" "[ResultX]"
StrLen "[Camera1.Data]" "[camImgSize]"
fnDebug "After Photo - Size:[camImgSize] Quality:[Camera1.Quality] base64:[ResultX]"

//load the captured data into webimage input field
SetVar "[vWebImage.Data]" "data:image/jpeg;base64,[Camera1.Data]" "String"
//Show the captured image on screen
SetAttribute "ImageDisplay" "src" "[vWebImage.Data]"


----------------------

So basically I'm taking a picture, and then saving the base64 data into some other variable.
i do this, since I might be getting the picture from more than one source.

Then I upload the image to the web.

What I cannot seem to fix, is to get the camera data to be bigger than 216x288 size?
It is always that size - no matter if I get it from the gallery, or if I get it from the camera.


I was hoping that specifying "TargetWidth" will get me a better quality image, but the image is always about 5K size and always width of 216 and length of 288. No matter what phone I use.

I seems as if the cordova camera plugin make the choice of 216x288? And we as users cannot override it?

ps. Just as a sidenote - If I lower the quality too much, I get a "Error compressing image" error.

Hope you can help me with this one!


This is my favourite quote.

Offline

#2 2016-12-06 18:26:24

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: Some rare issue with the Cordova Camera Image Size

Hello fakie,

Maybe you no need to use "Camera1.TargetWidth" nor "Camera1.TargetHeight" at all. But if you wanted (according to the documentation) you must use both and not only "Camera1.TargetWidth". Since I can see you use "Camera1.TargetWidth" but not "Camera1.TargetHeight" maybe this cause the issue. So try to set "Camera1.TargetHeight" or do not set "Camera1.TargetWidth".

P.S. You are using an old release of App Builder. Update your trial copy to the latest one so we can be sure we use the same release.

Offline

#3 2016-12-07 16:10:06

fakie
Banned
Registered: 2016-10-28
Posts: 36

Re: Some rare issue with the Cordova Camera Image Size

Thanks David.
That seems to be the issue - got it working.
I specified both the height and the width and then it all worked!

Great.

ps. For other people out there I can warn that you get an "JSON Error" unspecified , if you make the quality too low in the Cordova Camera Plugin.


This is my favourite quote.

Offline

#4 2016-12-07 19:20:21

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: Some rare issue with the Cordova Camera Image Size

Hello fakie,

fakie wrote:

Thanks David.
That seems to be the issue - got it working.
I specified both the height and the width and then it all worked!

Great.

ps. For other people out there I can warn that you get an "JSON Error" unspecified , if you make the quality too low in the Cordova Camera Plugin.

Glad to know you got it! Thanks for sharing the possible problems with the Cordova's Camera plugin with us!

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.