Hello,

I'm trying to override the Drupal default thumbnail image style to be scale and crop 10x10.

If I try that the following happens:

- The effect remains on 'crop' (should now be scale and crop)
- The dimensions are changed to 10x10
- 'Override defaults' submit button is displayed
- I get an error message: 'Notice: Undefined index: upscale in theme_image_scale_summary() (line 879 of /Websites/testbed/modules/image/image.admin.inc).'

If I click the override defaults button then all works fine (although I still get the undefined index error above).

This looks like a very similar issue to this: http://drupal.org/node/1648078#comment-6573544

Cheers,

Andrew

Comments

Andrew Edwards’s picture

In order to get this to work, I've added the following code to my features install file:

/**
 * Implements hook_install().
 */
function YOUR_FEATURE_install() {
  YOUR_FEATURE_load_image_style('large');
  YOUR_FEATURE_load_image_style('medium');
  YOUR_FEATURE_load_image_style('thumbnail');
}

function YOUR_FEATURE_load_image_style($image_style_name){
  $image_style = image_style_load($image_style_name);
   image_default_style_save($image_style);  
}

Which seems to do the job...
Any proper fixes greatly appreciated though.

Andrew

NaX’s picture

I just ran into this same problem. It looks like this patch was never committed. I don't know why.
#1339946: Features is not allowing export of overridden default image styles

I manually applied the patch from #20.

NaX’s picture

After spending some time with this, I found the patch to be buggy and your hook_install method is more reliable.

JurriaanRoelofs’s picture

Issue summary: View changes

hook_install method works well.

donquixote’s picture

Just saying: These styles are originally defined by image module, which is not a feature. So this is outside the usual use case for this module, I suppose.