posted 3 years ago
Some months ago I developed a special php web application for mobile phones.
Our customers use Samsung Galaxy xcover with Android and Opera Mobile for browsing the application.
I use a JS functionality called "navigator.getUserMedia". I think it's very powerful, but there's something I'm missing.
Look: I use "navigator.getUserMedia" to give the end user the possibility to make snapshots and upload the images to my webserver directory.
And it works fine, really!
But - and that's my problem - I haven't found out how to change resolution of these phone snapshots.
I tried to change some JS code phrases to define and configure image resolution how I want and how I need them. But no success!
Now I'm not sure if it's generally a JS problem. Could it be that the "navigator.getUserMedia" functionality doesn't have the possibilities I need?
Is anybody there who had or has the same problem?
Did anybody solve it?
There are a number of possibilities, but they boil down to two basic things:
Scale the snapshots on the server side
Scale the snapshot in the browser
On the server side you can use a library like ImageMagick or the built in image processing stuff in JRE or .Net. On the client, just use the standard canvas.drawImage() command with five parameters to scale it however you want.