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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | imagemagick_advanced-dimensions_passtrough-1550622.patch | 636 bytes | teezee |
Comments
Comment #1
teezee commentedPatch attached.
Comment #2
sunNice find. IIRC, I converted all of these effects from D6 to D7, but never tested them myself.
Can you roll a patch?
Comment #3
sunCross-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 ? :)
Comment #4
teezee commentedCo-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?
Comment #5
sunThanks 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.