I'm using Media 7.x-2.8, File Entity 7.x-2.2 and Drupal 7.56. I think the problem below appeared after upgrading from Media 7.x-2.0 and File Entity 2.0.

I have an image field for my content type and it is displayed using the large image style. The Wysiwyg editor/Wysiwyg Media components are hence not related to the issue. The inserted image has the right size, but the img tag has height and width attributes with values from the original image. This causes obvious problems. My very, very ugly workaround is to truncate the file_metadata so there is no width/height to insert.

Example HTML code:

<img typeof="foaf:Image" class="image-style-large" src="http://example.org/sites/default/files/styles/large/public/someimage.jpg?itok=sometoken" alt="" title="" width="749" height="562">

(The large image style is shrinking the image to 480 pixels as it should.)

Comments

hansfn created an issue. See original summary.

joseph.olstad’s picture

are you using wysiwyg or media_ckeditor?
if wysiwyg, which editor are you using? TinyMCE or ckeditor? or other?
are you using legacy rendering or regular? /admin/config/media/browser

joseph.olstad’s picture

meanwhile, you could try to step back to find out which release introduced this.
so revert to 7.x-2.0 and increment the release until the issue occurs.

hansfn’s picture

Issue summary: View changes
hansfn’s picture

As I wrote in the initial post this isn't related to Wysiwyg. The field is part of the display of the content type and not inserted in the body field (through the editor).

I wasn't able to track down when the problem occurred, but I was able to find which module that didn't like the upgrade - the Styles / File Styles module. This issue is a duplicate of #2795913: Dimensions of original image are used in generated HTML-code for thumbnails.

It seems that the "Media Styles" module (which used the Styles modules) is long gone, and maybe I can just remove the Styles module? It would be nice to get this confirmed. I'm of course testing this my self soon.

joseph.olstad’s picture

Title: Original image width / height inserted when using image styles » Original image width / height inserted when using (obsolete?) image_styles module
joseph.olstad’s picture

Title: Original image width / height inserted when using (obsolete?) image_styles module » Original image width / height inserted when using (obsolete?) styles module

here is the (obsolete?) project https://www.drupal.org/project/styles

joseph.olstad’s picture

Title: Original image width / height inserted when using (obsolete?) styles module » Original image width / height inserted when using the (obsolete?) styles module
Status: Active » Closed (won't fix)
joseph.olstad’s picture

Thanks for reporting