{"id":13743879,"url":"https://github.com/mroth/cameraform","last_synced_at":"2025-07-07T03:03:56.159Z","repository":{"id":717581,"uuid":"364658","full_name":"mroth/cameraform","owner":"mroth","description":":video_camera: Simple Flash+JS library for webcam capture and submission.","archived":false,"fork":false,"pushed_at":"2009-11-09T04:08:47.000Z","size":185,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-11T13:13:45.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mroth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-11-07T20:42:51.000Z","updated_at":"2021-01-15T15:34:55.000Z","dependencies_parsed_at":"2022-07-07T14:31:26.286Z","dependency_job_id":null,"html_url":"https://github.com/mroth/cameraform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fcameraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fcameraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fcameraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fcameraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mroth","download_url":"https://codeload.github.com/mroth/cameraform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241231739,"owners_count":19931208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:00:58.864Z","updated_at":"2025-02-28T20:48:31.912Z","avatar_url":"https://github.com/mroth.png","language":"ActionScript","readme":"CameraForm\n==========\nAttempt at creating an open source Flash+Javascript library for webcam capture of a static image that gets submitted via a form.  It should support the easy embedding of a capture frame into a HTML form with other parameters.\n\nThe idea being that developers wont have to mess around with evil Flash/AS themselves, and instead can download a handy precompiled library that they just interact with via HTML/JS land. \n\nObviously what would be more ideal would be browser support for [`\u003cinput type=camera\u003e`](http://ajaxian.com/archives/input-camera) but that was apparently nixed from the HTML5 spec, so for now, this!\n\n\nDifferences from jpegcam\n------------------------\nThis project is forked from [jpegcam](http://code.google.com/p/jpegcam/) (v1.08) by jhuckaby.  The notable changes are:\u0010\n\n* Adding support for getting back the JPEG as a base64 encoded string, so you can submit it via a standard HTML form after you insert the value via Javascript.  This makes it much more flexible for usage in web apps, and is consistent with the goal of doing as little in Flash as possible.\n* TODO: Adding `console.log` calls via ExternalInterface in addition to `trace()`, for ease of debugging in web browser with Firebug.\n* Putting it on github, since git and github are awesome and allow for easier collaboration.\n\nAs per the parent project, it is licensed under LGPL license terms.\n\nUsage\n-----\nFor now, look at the [jpegcam documentation](http://code.google.com/p/jpegcam/wiki/Instructions) for basic setup stuff.\n\n*The main difference here is that once you `freeze()` the image, instead of calling `upload()`, you can call `dump()` instead, which will return a base64 encoded JPEG to the callback handler.*\n\nOnce you get the return value in the callback, you can just stick it in a hidden form value:\n\t\n\t\u003cform onSubmit='doSomething();'\u003e\n\t\t\u003c!-- your other form stuff here --\u003e\n\t\t\u003cinput type='hidden' id='img_data'\u003e\n\t\t\u003cinput type='submit' id='submit_button' disabled='true'\u003e\n\t\u003c/form\u003e\n\t\u003cscript language=\"JavaScript\"\u003e\n\t\twebcam.set_hook( 'onComplete', 'completion_handler' );\n\t\n\t\tfunction completion_handler(data) {\n\t\t\tdocument.getElementById('img_data').value = data;\n\t\t\tdocument.getElementById('submit_button').disabled = false;\n\t\t}\n\t\u003c/script\u003e\n\nI'm assuming you already know what to do with a form!\n\nYou can even preview it by writing a data-uri into the src of an image.  Assuming we have an image with `id=preview`, then:\n\n\tvar p = document.getElementById('preview');\n\tp.src = 'data:image/jpeg;base64,' + data;\n\nFun for the whole family.\n\nDemo\n----\nProbably easiest to just look at the source code on [the demo page](http://mroth.github.com/cameraform/htdocs/test.html).\n\nLicense\n-------\nLGPL\n","funding_links":[],"categories":["File Formats"],"sub_categories":["JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fcameraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmroth%2Fcameraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fcameraform/lists"}