Experimental project
This is a sandbox project, which contains experimental code for developer use only.
A simple Drupal module which allow site administrator to configure image field to not allow pornographic image upload and enable the pornographic detection for user profile picture.
Requirements
This module uses two third party libraries:
Steps:
- Download and extract module under
sites/all/modules
- Download and extract
Libraries
module. -
- Download one of the library or both.
- Php nudity detector
- Image nudity filter
- Extract and put the library under
sites/all/libraries/
and make sure path issites/all/libraries/php-nudity-detector
(for php nudity detector library) andsites/all/libraries/image-nudity-filter
(for Image nudity filter library). - Enable the module and configure any
image field
added in content type and check the pornographic detection option. Check the pornographic detection for user profile picture under account settings/admin/config/people/people/accounts
Known issue
IF you use Image nudity filter library.
Notice: imagecolorat(): 1,400 is out of bounds in ImageFilter->GetScore() (line 62 of class.ImageFilter.php).
Solution:
After downloading Image nudity filter edit ImageFilter->GetScore() method in class.ImageFilter.php file at line 58 and 60 change less then or equal <=
operator to less then <
operator.
Change:
for($i=1; $i<=$x; $i++)
{
for($j=1; $j<=$y; $j++)
{
to:
for($i=1; $i<$x; $i++)
{
for($j=1; $j<$y; $j++)
{