I use Drag and Drop upload along with the Focal Point module to set a focal point for automatic cropping.

This extra code is needed to make it work...

function dragndrop_upload_image_focal_point_supported_widget_types_alter(&$supported) {
  $supported[] = 'dragndrop_upload_image';
}
function focal_point_widget_dragndrop_upload_image_process($element, &$form_state, $form) {
  return focal_point_widget_image_image_process($element, $form_state, $form);
}

Comments

webevt’s picture

Status: Active » Needs work

Hi, darrenmothersele

Thank you for your interest in this module! It will be great if you will create a patch so I'll be able to give credit to you. Please, take a moment to look into this article.

Regards

webevt’s picture

Status: Needs work » Fixed

Hi

I've created the patch and commited it to dev branch. Now DnD Upload has integration with Focal Point module.

Regards

  • WebEvt committed 78e4baa on 7.x-1.x
    Issue #2262079 by webevt: Added integration with Focal Point
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ydahi’s picture

For anyone wondering (as I was), this feature has not made it into the current alpha release (7.x-1.0-alpha2).

To get this feature working you can either use the dev branch or add the following code to the end of the file /sites/all/modules/dragndrop_upload/modules/dragndrop_upload_image/dragndrop_upload_image.module:

/**
 * Implements hook_focal_point_supported_widget_types_alter().
 *
 * Adds integration with module Focal Point.
 */
function dragndrop_upload_image_focal_point_supported_widget_types_alter(&$supported) {
  $supported[] = 'dragndrop_upload_image';
}

/**
 * Process callback of dragndrop_upload_image widget for Focal Point module.
 *
 * Adds integration with module Focal Point.
 *
 * @see focal_point_field_widget_form_alter().
 */
function focal_point_widget_dragndrop_upload_image_process($element, &$form_state, $form) {
  return focal_point_widget_image_image_process($element, $form_state, $form);
}