Hi,

since Drupal 7.9 the image dimensions are back in the html rendering of image tags. To support this, you seem to have to add a 'dimensions callback' to the function filtersie_image_effect_info().

Comments

Wolfgang Reszel’s picture

jstoller’s picture

I second this. I just spent several hours trying to figure out why dimensions weren't showing up on my images and finally traced it back to this module. Unfortunately, I have some jQuery that relies on those dimensions being there.

nils.destoop’s picture

I was busy with this, but then saw that the dimensions callback doesn't pass the file info. Because of this, it's impossible to know which crop selection needs to be loaded.

Anyone knows a trick for this?

Speicus’s picture

ianthomas_uk’s picture

An incomplete and disabled fix for this was committed for some reason, I've removed that fix in http://drupalcode.org/project/imagecrop.git/commitdiff/75ecbca1c277cc0f2...

bburg’s picture

Issue summary: View changes

Re: #4, that is an 8.x core issue. Perhaps I am a bit confused on where the complexity is here. We just need something to set the dimensions, right? So:

imagecrop_image_effect_info() should add

    'dimensions callback' => 'imagecrop_dimensions',

and the callback is as simple as:

function imagecrop_dimensions(&$dimensions, $data) {
  $dimensions['width'] = $data['width'];
  $dimensions['height'] = $data['height'];
}

While this doesn't appear to set the native height and width properly, it at least sets the height and width properties of my image elements, which fixes a lot of heardache that's happened after a recent update to media.