When the Strip metadata (strip) effect from imagemagick_advanced.module is added to an image style, the dimension calculation performed by image_style_transform_dimensions() changes the width and height to NULL.

All effects that can be applied to images need to either provide a 'dimensions callback' or a 'dimensions passthrough' to state that the effect changes the image dimensions or that it has no effect on dimensions. As the strip effect currently doesn't provide either, width and height are set to NULL. This can be overcome by adding 'dimensions passthrough' to the strip effect declaration.

     'label' => t('Strip metadata'),
     'help' => t('Resizing will make images an exact set of dimensions. This may cause images to be stretched or shrunk disproportionately.'),
     'effect callback' => 'imagemagick_advanced_strip_effect',
+    'dimensions passthrough' => TRUE,
   );
   return $effects;

More information on the image style dimension calculation, and theme_image_style() where it is invoked.

Comments

teezee’s picture

Status: Active » Needs review
StatusFileSize
new636 bytes

Patch attached.

sun’s picture

Status: Needs review » Active

Nice find. IIRC, I converted all of these effects from D6 to D7, but never tested them myself.

Can you roll a patch?

sun’s picture

Status: Active » Needs review

Cross-post, sorry. Thanks!

btw, would you be interested in co-maintaining ImageMagick? If so, would you be comfortable with the rules outlined on http://drupal.org/node/363367 ? :)

teezee’s picture

Co-maintaining in committing patches and some support OK, but my understanding of the 'rules' is practically non-existent. Read them but cant find what I might have missed? Is it the root path for the patch?

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed to 7.x-1.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Happy to discuss co-maintenance again.

Status: Fixed » Closed (fixed)

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