Page MenuHomePhabricator

Thumbnail not displaying because of srcset attribute
Closed, DuplicatePublic

Description

Error

Steps to Reproduce:

1) Requirements :

a) Server Side :

  • Hosting Mediawiki on debian 9 server
  • PHP 7.0.30-0+deb9u1 (apache2handler)
  • MariaDB 10.1.26-MariaDB-0+deb9u1
  • ICU 57.1

b) Client Side :

  • Use Firefox Quantum 63.0.1 (64-bit)

2) Reproduce

a) First Step

  • Create a local MediaWiki v1.29.1
  • Add Visual-Editor and configure parsoid on it
  • Connect, add images on a page

b) Second Step

  • Migrate from MediaWiki v1.29.1 to MediaWiki 1.31.1 : Copying LocalSettings.php, images/ from v1.29.1 file to 1.31.1 file. Download Visual-Editor. Import previous database and use update.php.
  • I set parsoid config to scriptAcceptCheck : false to avoid problems of HTTP Code with Visual Editor

3) Now the problem

  • Login with your account created during the 1.29.1 version
  • Go to the page where you created your images

Impact

Thumbnails aren't displayed because of the attribute srcset added to the <img> tag. This is the content of the srcset that I get :
srcset = "/mediawiki/images/thumb/0/03/y_X_y.png/450px-y_X_y.png 1,5x, /mediawiki/images/thumb/0/03/y_X_y.png/600px-y_X_y.png 2x"

Notes

The name of the picture in this example is "y_X_y.png" because mine was having underscore and capital letters in it.

When I add this option in LocalSettings.php to disable the attribute srcset, everything goes back to normal and thumbnails are displayed again :
$wgResponsiveImages= false;

The problem might come from the " 1,5x, " and " 2x" inserted in the srcset.

Request ID: 2018-11-07-srcset

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 7 2018, 11:39 AM

(not an error on Wikimedia production servers, hence removing tag.)

Hi @MaltemoSveg, thanks for taking the time to report this and welcome to Wikimedia Phabricator!

This is the same problem as in T181987 so I am closing this task as a duplicate.

Thank you and sorry for wasting your time. I think though that it would be a good idea to add a this problem on this part of the wiki (https://www.mediawiki.org/wiki/Manual_talk:Image_administration) to help people that had the same problem but didn't know about this issue.

Thank you and sorry for wasting your time.

You did not, no worries! :)

I think though that it would be a good idea to add a this problem on this part of the wiki (https://www.mediawiki.org/wiki/Manual_talk:Image_administration) to help people that had the same problem but didn't know about this issue.

Feel free to go ahead.

Job done :) !

Have a great day !