After upgrading to the most recent dev versions of Media 7.x-2.x and File Entity, the width and height attributes (set as data-width and data-height) seem to no longer be supplied by media_token_to_markup() for images inserted using the WYSIWYG module.
I tried looking for another issue on d.o that addressed this, but wasn't able to find one. I also tried to figure out why $variables['width'] and $variables['height'] seem to be NULL in theme_picture_formatter(), but I was pretty unsuccessful.
Here's a workaround patch that appears to solve my issue. I'm not sure if there are any negative side effects to this patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | picture-file-entity-metadata-2101779-1.patch | 739 bytes | drupal_was_my_past |
| picture-get-image-dimensions-regardless-of-variable.patch | 732 bytes | drupal_was_my_past |
Comments
Comment #1
drupal_was_my_past commentedI finally tracked down the problem. The newest File Entity switches from storing data on the
$fileobject in an array calledimage_dimensionsto an array calledmetadata. This corresponds to the File Entity removing the image dimensions table in favor of the file_metadata table.Here is a patch that will put the heights and width attributes back on images when Picture is used with the latest versions of File Entity and Media.
Cheers,
Rocket
Comment #2
attiks commentedPatch from #1 applied, changed a bit to support both versions.
Thanks