Hi,

I have added manualcrop to the oa_banner image_style

I have uploaded a banner.
I hit manual crop
It saves the area.

I hit the save button for media browser.
I then hit the save button for the space.

The manualcrop image is not used. Only the original is used.

I am not sure if it is a conflict with the scale (800x200)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SocialNicheGuru created an issue. See original summary.

SocialNicheGuru’s picture

Title: How do I use manualcrop with oa_banner? » Have manualcrop work with oa_banner
Version: 7.x-2.68 » 7.x-2.69
Category: Support request » Feature request
Related issues: +#2371993: Scale/crop uploaded banner images

argghhhh... how do I remove crop? That is a horrible UI experience. Let's just remove it from media when it is called for the oa_banner field

mpotter’s picture

I'm sure you can just disable the crop module if you don't want it, or edit the specific field and disable crop for that field. But this module integration with Media comes from Panopoly so any feedback on how it is used should go there or directly to the specific crop module issue queue. If there is something that needs to be fixed specifically in Atrium then patches are welcome.

magulaiz’s picture

I've found the same problem. Here it is how you can solve it hacking the OpenAtrium code, waiting for a right patch:

Module: oa_appearance
version: 7.x-2.7

File: /OPENATRIUM_ROOT/profiles/openatrium/modules/apps/oa_appearance/plugins/content_types/oa_space_banner.inc

[...]
/**
* Render callback for the panel.
*/
   function oa_space_banner_render($subtype, $conf, $args, $context = NULL) {
[...]
   $vars['banner_class'] .= (!empty($banner['stretch'])) ? ' oa-banner-stretch' : ' oa-banner-nostretch';
-  $vars['banner'] = !empty($banner['image']) ? theme('image', $banner['image']) : '';
+  $vars['banner'] = !empty($banner['image']) ? theme('image_style', $banner['image']) : '';
   $vars['width'] = isset($banner['image']['width']) && !empty($banner['stretch']) ? $banner['image']['width'] : 0;
[...]

File: /OPENATRIUM_ROOT/profiles/openatrium/modules/apps/oa_appearance/oa_appearance.module

[...]
function oa_appearance_get_space_banner($space_id, $banner_position) {
[...]
        if ($space_image && $space_position == $banner_position) {
[...]
          $banner['image'] = array(
            'path' => $space_image['uri'],
            'width' => $space_image['width'],
            'height' => $space_image['height'],
            'alt' => $space_image['alt'],
            'title' => $space_image['title'],
         +  'style_name' => 'panopoly_image_full',
            'attributes' => array(
              'class' => array('oa-banner-overlay-img'),
            ),
          );
[...]
        else {
[...]
            if ($site_file) {
              $banner['image'] = array(
                'path' => $site_file->uri,
                'width' => !empty($site_file->metadata['width']) ? $site_file->metadata['width'] : 0,
                'height' => !empty($site_file->metadata['height']) ? $site_file->metadata['height'] : 0,
                'alt' => t('Site banner'),
             +  'style_name' => 'panopoly_image_full',
                'attributes' => array(
                  'class' => $site_stretch ? array('oa-banner-overlay-img') : array('oa-banner-img'),
                ),
              );
[...]

NOTE: This solution only has sense on setting "Banner Position" to "Below toolbar (Stretched)"

magulaiz’s picture

Patch against oa_appearance 7.x-2.x, according to previous comment.

magulaiz’s picture

mpotter’s picture

While this is likely a good idea, I cannot go with this solution because it could break existing sites. The banner image was specifically designed to display the exact banner image that was uploaded with no image_style modifications. The panopoly_image_full image style used in this patch scales the width to 960, so would break existing site banner images.

To really fix this and support cropping, need to create a new image style that doesn't modify the image except to enable the cropping plugin.