When I use smartcrop as the only image effect the width and height attributes are gone. I tracked it down to the "image_style_transform_dimensions" function in images.module. Since both image effect don't have a "dimensions passthrough" nor a "dimensions callback" element dimensions are set to NULL.

The fix is to add a valid dimensions callback, since the image size can change.
The core callback "image_resize_dimensions" works perfectly for me.

Attached the patch to fix this.

CommentFileSizeAuthor
#2 add_dimensions.patch789 bytessteven jones
add_dimensions.patch933 byteskeesje

Comments

steven jones’s picture

Issue summary: View changes
Status: Active » Needs work

Patch needs a re-roll.

steven jones’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2
Status: Needs work » Needs review
StatusFileSize
new789 bytes

Status: Needs review » Needs work

The last submitted patch, 2: add_dimensions.patch, failed testing.

attiks’s picture

This is breaking picture module since we need the dimensions to be able to output the right sizes.

rainbowarray’s picture

Not sure why tests are failing on this, but verified that this patch works and fixes the issue with picture.

attiks’s picture

Test images aren't found