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

Libraries API

This module uses two third party libraries:

Steps:

  1. Download and extract module under sites/all/modules
  2. Download and extract Libraries module.
  3. Extract and put the library under sites/all/libraries/ and make sure path is sites/all/libraries/php-nudity-detector (for php nudity detector library) and sites/all/libraries/image-nudity-filter(for Image nudity filter library).
  4. 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++)
    {

Project information

  • Module categories: Media
  • Created by msankhala on , updated