Page MenuHomePhabricator

Images not rendered in MediaViewer when accessed from a mobile device from the classic view: thumbnail width determined incorrectly
Open, LowPublic

Description

Setup

  • MediaWiki 1.31.8 (c759d64) 24. Jun. 2020, 18:19
  • PHP 7.2.13-1 0~20181207100540.13 stretch~1.gbpf57305 (apache2handler)
  • MariaDB 10.1.37-MariaDB-0 deb9u1
  • MobileFrontend 2.1.0 (db6d3d1) 7. Jan. 2020, 21:02
  • MultimediaViewer – (1273d3e) 11. Mai 2018, 21:57

Issue
Four cases:

  1. Accessing photos via desktop computer with MobileFrontend and with MultimediaViewer - works
  2. Accessing photos via desktop computer without MobileFrontend and with MultimediaViewer- works
  3. Accessing photos via mobile device with MobileFrontend and with MultimediaViewer - works
  4. Accessing photos via mobile device without MobileFrontend and with MultimediaViewer - does not work

This wiki uses a file handler, i.e.

$wgGenerateThumbnailOnParse = false;
$wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
$wgMediaViewerUseThumbnailGuessing = false; // Broken since 1.31.x so false

and

<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
	RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]

	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
	RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/] )/([0-9] )px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]

	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
	RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/] )/([0-9] )px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
</IfModule>

Since the first 3 use cases work allrighty I do not think that the file handler is at fault. I am aware that the non-working use case #4 is not really a standard one however I get a "complaint" once in a while.

Example pAGE: St. Matthäus (Rittershausen)

Event Timeline

Example pAGE: St. Matthäus (Rittershausen)

Likely not a test case as https://wuerzburgwiki.de/wiki/Spezial:Version says that MobileFrontend is installed, but your description says it should not be installed.

What happens when they are "not rendered"? Still a black background shown but no image? Any error messages in some log (e.g. webserver)?

... but your description says it should not be installed.

No, you misunderstood since case 4 does not appear to be frequent (valid?) a use case. I agree with you that ... On this wiki MobileFrontend is indeed installed as it should be. However a lot of users seem to use MonoBook even on mobile devices. This does not work for some reason.

The issue does not create errors in the log. It looks like this and it appears that the thumbs are not being created which in turn cannot be true since it works for the 3 other use cases perfectly. Moreover before getting this error screen the image shows up for a glimpse of time.

Screenshot_20200716-165038_Firefox.jpg (2×1 px, 208 KB)

@Kghbln: Is there a public testcase (URL) for this somewhere?

Sure, no probs. The link to the file needs to be opened fromm a mobile device. If this link for some automatically uses MobileFrontend you have switch to classic view.

In case more information on this is required, I will try to get access to them.

A clear list of steps which allow someone else to manage to reproduce would help. :P

Cannot reproduce I think?

  1. Take out mobile phone
  2. Go to https://wuerzburgwiki.de/w/index.php?title=St._Matthäus_(Rittershausen) on an ancient mobile phone running a browser based on Firefox 45 (sic!)
  3. Scroll to bottom and explicitly switch to Desktop version
  4. Let desktop version load
  5. Click first image on the right of the page
  6. Get something which looks like MediaViewer to me:

Screenshot_20200819_002.png (960×540 px, 449 KB)

A clear list of steps which allow someone else to manage to reproduce would help. :P

Well, indeed. The steps you went through are exactly the steps to get to the failure:

Screenshot_20200819-114332_Firefox.jpg (2×1 px, 207 KB)

So this is either device specific, OS specific or browser specific.

I use a Samsung Galaxy 8 with Android 9 on Firefox 68. Chrome 84 fails too on this device.

FYI this can be reproduced in Chrome DevTools' mobile view (emulator) after switching to Classic View.

The problem is that in Classic View this image would be loaded:
https://wuerzburgwiki.de/w/thumb.php?f=Rittershausen_Sankt_Matthaeus_Suedansicht.jpg&width=2560
See the error message at this link.

Whereas in Mobile View:
https://wuerzburgwiki.de/w/thumb.php?f=Rittershausen_Sankt_Matthaeus_Suedansicht.jpg&width=800

The thumbnail width is determined incorrectly. I haven't tracked the issue further.

Aklapper renamed this task from Images are not rendered in the MultiMedia view when accessed from a mobile device from the classic view to Images not rendered in MediaViewer when accessed from a mobile device from the classic view: thumbnail width determined incorrectly.Aug 19 2020, 2:32 PM

@Demian Thanks a lot for your comment and tracking down the issue. Hopefully it gets fixed one day.

I was able to mitigate this for the time being by setting $wgMaxShellMemory = 1024000;. Was at half a GB before but obviously this was not enough. This part I could or should have figured out myself. Still this is only mitigating the symptoms and not the underlying issue.

Kghbln updated the task description. (Show Details)
Aklapper triaged this task as Low priority.Jul 14 2022, 9:51 AM

In this case, we are talking about a public wiki.

In this case, we are talking about a public wiki.

Yes but both use thumb.php and/or thumb_auth.php
Thats all related.