aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Mobile Phones: Using JavaScript to make snapshots via phone camera Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Mobile Phones: Using JavaScript to make snapshots via phone camera" Watch "Mobile Phones: Using JavaScript to make snapshots via phone camera" New topic
Author

Mobile Phones: Using JavaScript to make snapshots via phone camera

Dariusz Helmholtz
Greenhorn

Joined: Nov 22, 2012
Posts: 1
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
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 295
    
    5

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.


    Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
     
    Don't get me started about those stupid light bulbs.
     
    subject: Mobile Phones: Using JavaScript to make snapshots via phone camera