Description
Webcam field widget module provides a "photoboot" widget for the Field API. Instead of uploading images to an image field attached with Field API to a content type you can use your webcam to capture an image.

To use the module just add an image field to your content type and select the webcam field widget as the widget for the field.

Similar projects
Media Webcam: Created for Drupal 6 CCK. Not working on Drupal 7. Also provides video capture capabilities.
Mugshot: Drupal 5 version only.
Camera field: Based on Mugshot, only beta for Drupal 6. Does not provide source of flash file.

Not similar projects but similar names:
Wecams: Provides "dynamically updating webcam nodes."
Webcam field: Same as above.

Links:
Link to project.
Git access: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ooystein/1616836.git webcam_field_widget

CommentFileSizeAuthor
#2 webcam1.png27.21 KBpranit84
#2 webcam2.png18.8 KBpranit84
#2 webcam3.png11.35 KBpranit84

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxooystein1616836git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

pranit84’s picture

StatusFileSize
new11.35 KB
new18.8 KB
new27.21 KB

Manual Review
Concept of this module is really good, i downloaded this module and enabled it.
After that i added a field of image type and widget as webcam with unlimited value property.

Till then everything looks fine.
Once i opened the node form to check the functionality. I found it is not working as desired.
Sharing some screenshots for more clarification.

webcam1.png: On opening node/add/ form. It looks like this. Even after clicking allow, nothing happens.
webcam2.png: On clicking

add another item

. Blank boxes appeared.
webcam3.png: Automatically those boxes gets changed with the error messages.

In short, it doesn't worked for me.

ooystein’s picture

Status: Needs work » Needs review

PA robot's feedback is taken to account in commit b6dca4b.

pranit84: thanks for the review.
This problems is solved in commit ec874ebe. Multiple field values can now be handled.
Some problems with jQuery 1.5 though. Upgrade to jQuery 1.7 to use multiple field inputs.

linwiz’s picture

Manual review:
I had no issues getting this module to work, easy to use.

Automated review:
Issues are reported at http://ventral.org/pareview/httpgitdrupalorgsandboxooystein1616836git

I ran this through coder module, reports:

Coder found 1 projects, 3 files, 1 critical warnings, 6 normal warnings, 9 minor warnings, 0 warnings were flagged to be ignored
webcam_field_widget.js

File: @file block missing (Drupal Docs) [comment_docblock_file]
webcam_field_widget.module

Line 136: Missing parameter type at position 1 [sniffer_commenting_functioncomment_missingparamtype]
* @param $field array
Line 139: Missing parameter type at position 2 [sniffer_commenting_functioncomment_missingparamtype]
* @param $instance array
Line 177: There should be no trailing spaces [style_trailing_spaces]
*
Line 182: Missing parameter type at position 1 [sniffer_commenting_functioncomment_missingparamtype]
* @param $element array
Line 185: Missing parameter type at position 2 [sniffer_commenting_functioncomment_missingparamtype]
* @param $form_state array
Line 229: Submit and validate handlers return values are ignored. [druplart_submit]
return FALSE;
Line 237: Consider putting the assignment on a line above the conditional for better readability. [druplart_conditional_assignment]
if (!$file_object = file_save_data($file_data, $destination, $replace = FILE_EXISTS_RENAME)) {
Line 239: Potential problem: form_set_error() and form_error() only accept filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs) [security_5]
form_set_error(implode('_', $element['#parents']), t('The image in the !name field was unable to be uploaded.', array('!name' => $element['#title'])));
Line 240: Submit and validate handlers return values are ignored. [druplart_submit]
return FALSE;
Line 244: Submit and validate handlers return values are ignored. [druplart_submit]
return FALSE;
Line 261: Missing parameter type at position 1 [sniffer_commenting_functioncomment_missingparamtype]
* @param $file object
Line 264: Missing parameter type at position 2 [sniffer_commenting_functioncomment_missingparamtype]
* @param $validators array
Line 268: Return comment indentation must be 2 additional spaces [sniffer_commenting_functioncomment_paramcommentindentation]
* validation status
Line 331: Submit and validate handlers return values are ignored. [druplart_submit]
return FALSE;
Line 334: Submit and validate handlers return values are ignored. [druplart_submit]
return TRUE;

ooystein’s picture

Thanks linwiz.

All reported coder warnings have been addressed in latest commit. Some new coder warnings arrived but will be fixed in next commit.

dclavain’s picture

Status: Needs review » Needs work

Hi @ooystein

automated report
FILE: /var/www/drupal-7-pareview/pareview_temp/webcam_field_widget.js
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
125 | ERROR | Expected 1 space after ">"; 0 found
125 | ERROR | Expected 1 space before ">"; 0 found
126 | ERROR | Expected 1 space after ">"; 0 found
126 | ERROR | Expected 1 space before ">"; 0 found
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/webcam_field_widget.module
--------------------------------------------------------------------------------
FOUND 7 ERROR(S) AND 1 WARNING(S) AFFECTING 8 LINE(S)
--------------------------------------------------------------------------------
137 | ERROR | Parameter comment indentation must be 2 additional spaces at | | position 1
140 | ERROR | Parameter comment indentation must be 2 additional spaces at | | position 2
183 | ERROR | Parameter comment indentation must be 2 additional spaces at | | position 1
185 | ERROR | Missing comment for param "$form_state" at position 2
262 | ERROR | Parameter comment indentation must be 2 additional spaces at | | position 1
265 | ERROR | Parameter comment indentation must be 2 additional spaces at | | position 2
268 | ERROR | Return comment indentation must be 2 additional spaces
334 | WARNING | Empty return statement not required here
--------------------------------------------------------------------------------

Manual review

I have installed your module to me, I've created a content and I have taken a snapshot and all this correctly, but to save the contents leaves me the image by default instead of the taken snapshot.

Images correctly creates the folder site/default/file but when loading the node displays the image by default.

ooystein’s picture

Status: Needs work » Needs review

Thank you for your review dclavain!

The last commit had introduced a new bug in the validation function and therefor the image was not saved. This have now been fixed. Pleas try again if you wish.

Concerning the automated review I have now fixed everything that actually is an error. The 'Expected 1 space after ">"; 0 found' errors comes from a shortcoming in the automated reviewer. Is does not recognize bit shift operators.

And I can't seem to get rid of the "Parameter comment indentation must be 2 additional spaces at | | position 1" errors. I tried to indent with 2 spaces but it didn't seem to help...

dclavain’s picture

Status: Needs review » Needs work

Hi ooystein

I just try your module and it works fine.

You still have failures of indentation in the module file.

/**
 * Retrieves the upload validators for a webcam_field_widget.
 *
 * @param array $field
 *          a field array
 *
 * @param array $instance
 *          the field instance
 *
 * @return array
 *   An array suitable for passing to _webcam_field_widget_file_validator() or
 *   file_save_upload() or the file field
 *   element's '#upload_validators' property.
 */

The comment parameter must have 2 no 9 spaces.

/**
 * Retrieves the upload validators for a webcam_field_widget.
 *
 * @param array $field
 *   A field array.
 *
 * @param array $instance
 *   The field instance.
 *
 * @return array
 *   An array suitable for passing to _webcam_field_widget_file_validator() or
 *   file_save_upload() or the file field
 *   element's '#upload_validators' property.
 */

This is repeated in the 183, 186, 258, 261, 264 lines

ooystein’s picture

Status: Needs work » Needs review

Ok, thanks. I'll fix the indentation in next commit.

Don't think its critical though so returning status to needs review.

grandivory’s picture

Status: Needs review » Reviewed & tested by the community

I found no major issues in this project.
The following are all of my notes on things that should be checked/improved, but which are not critical.

Notes:

  • As soon as I first went to the node/add page, the site became so slow as to be almost unresponsive. This was not an issue on subsequent attempts. (I assume this was some flash error)
  • On my second attempt (when I was able to get the widget working), the click events did not line up with the buttons on the flash object, making it difficult to allow the use of my camera - not sure if there's anything you can do about that, though, as that's just part of flash.
  • This module relies on functions from the "file" module - make sure that's included in your .info file
  • On line 113 of webcam_field_widget.module, you have a line of code commented - is that meant to be removed?
  • On line 228 of webcam_field_widget.module, you don't need the argument "$default = 0" since you don't use $default again. It can just be "0".
  • Since you always save as a .jpeg, shouldn't you only need that one file type on line 285?
  • You haven't yet fixed the indentation from comment #8
  • For multi-value fields, every time a new instance is added, the flash widget asks for permission for the camera again on ALL fields

Things that should be added to README.txt and your project overview:

  • Since you are using the canvas element without an included fallback, you should specify that this will not work in IE8 or below.
  • You should also specify that you rely on flash to make this work.
  • State that this takes pictures in a specified size (possibly turn this into a configuration option?) and that people should configure the field to allow that size for their images.
  • State that your widget saves files in jpeg format
RavindraSingh’s picture

Module is working fine as i have tested. @ooystein did good job.

@grandivory minor issues (suggestion/improvements) are not needed currently they can be implemented on next release of the module. your all point are valid. Thanks

kscheirer’s picture

Status: Reviewed & tested by the community » Needs work

You have some minor issues reported at http://ventral.org/pareview/httpgitdrupalorgsandboxooystein1616836git. The points in #10 should be addressed, especially the missing requirement in the .info file.

I see you've already listed some similar modules - if the D7 version of Media Webcam isn't working would it be possible to fix this version or take over maintainership instead? It doesn't look like there have been any commits in the last year.

PAReview: 3rd party code
jscam appears to be 3rd party code. 3rd party code is not generally allowed on Drupal.org and should be deleted. This policy is described in the getting involved handbook. It also appears in the terms and conditions you agreed to when you signed up for Git access, which you may want to re-read, to be sure you're not violating other terms.

The Libraries API module is a recommended method for adding 3rd party dependencies without directly including the code on Drupal.org.

Duplication
This sounds like a feature that should live in the existing Media Webcam project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the Media Webcam issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.

If that fails for whatever reason please get back to us and set this back to "needs review".

----
Top Shelf Modules - Crafted, Curated, Contributed.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Change git access url. Make paragraph headings.