This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mobile Phones: Using JavaScript to make snapshots via phone camera  RSS feed

Dariusz Helmholtz
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi together,

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 checked the whole JavaScript code if there's a possibility to define resolution information but without any luck.
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?

Rob Crowther
Ranch Hand
Posts: 297
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!