Topic on Extension talk:PdfHandler

Thumbnails not appearing

11
Huwmanbeing (talkcontribs)

I run MediaWiki 1.33 on Ubuntu with the latest version of PdfHandler, but thumbnails aren't being shown for PDFs. There's no obvious error being generated, the thumbnail images just don't appear. (Embedding a link like [[File:Sample.pdf|page=1|thumb|Test]] produces only the text link with no image, and the file page itself shows only the generic PDF file type icon.)

I've verified I have all the necessary prerequisites:

  • /usr/bin/gs
  • /usr/bin/convert
  • /usr/bin/pdfinfo
  • /usr/bin/pdftotext

I've run the recommended maintenance scripts, but still no luck. I've also made sure it's appropriately configured in my LocalSettings.php — the settings are present and identical to the default settings. Does anyone have any ideas/suggestions as to what might be causing thumbnails not to appear? Any assistance would be much appreciated! Huwmanbeing (talk) 14:33, 7 September 2019 (UTC)

This post was hidden by Heinebold (history)
Huwmanbeing (talkcontribs)

Thanks very much for the suggestions — unfortunately no luck. No thumbnails in links, and the file page still just shows the PDF icon and the 0 x 0 size.

I seem to have hit a wall here: everything's apparently set correctly as far as I can tell, and there are no obvious errors, but it just doesn't work. Could anyone suggest ways to debug this?

Kghbln (talkcontribs)

Try this:

  1. Have a look if you have a "temp" directory at path/to/images/temp
  2. If not create this directory: mkdir path/to/images/temp
  3. Make it writable for the webserver chown www-data:www-data path/to/images/temp
  4. Run php path/to/maintenance/refreshImageMetadata.php -f
  5. Run php path/to/maintenance/rebuildImages.php
Huwmanbeing (talkcontribs)

I've confirmed that "images/temp" is present and chown-ed properly to www-data, and have run the maintenance scripts, but unfortunately still no luck.

I'm curious, though — what should one normally see when running rebuildImages.php? Here's what it's showing me:

Processing image... [...] Finished image... 0 of 852 rows updated Processing oldimage... Finished oldimage... 0 of 13 rows updated

Is the fact that it's reporting no rows updated in any way significant?

Kghbln (talkcontribs)

0 just means that there was nothing to update. The more interesting script is the one of point 4. If this ran without throwing errors you should be fine, i.e. no longer pdf files with 0 x 0 size. Cannot tell why it is not working for you now. :( I guess I am really out of ideas now. The permissions of "temp" are ok with 755?

Huwmanbeing (talkcontribs)

A breakthrough — I decided to start disabling all installed extensions just to see if there might be something there that's interfering, and I found that turning off TimedMediaHandler allows PDFs to be displayed and thumbnailed correctly. Now when refreshImageMetadata runs it does so successfully (well, mostly — it gives some warnings about some metadata inconsistencies in some of my .ogg files). I'll investigate further and see if I can find out more specifically what's happening, but at least it's working now.

Huwmanbeing (talkcontribs)

Here's the fault:

PHP Notice: Undefined offset: 0 in [...]/includes/libs/mime/MimeAnalyzer.php on line 811
[5cd1086a420507df361326be] [no req]   Error from line 15 of [...]/extensions/TimedMediaHandler/includes/handlers/ID3Handler/ID3Handler.php: Class 'getID3' not found
Backtrace:
#0 [...]/extensions/TimedMediaHandler/includes/handlers/ID3Handler/ID3Handler.php(51): ID3Handler->getID3(string)
#1 [...]/includes/utils/MWFileProps.php(84): ID3Handler->getMetadata(FSFile, string)
#2 [...]/includes/filerepo/FileRepo.php(1560): MWFileProps->getPropsFromPath(string, string)
#3 [...]/includes/filerepo/file/LocalFile.php(402): FileRepo->getFileProps(string)
#4 [...]/includes/filerepo/file/LocalFile.php(710): LocalFile->loadFromFile()
#5 [...]/maintenance/refreshImageMetadata.php(173): LocalFile->upgradeRow()
#6 [...]/maintenance/doMaintenance.php(96): RefreshImageMetadata->execute()
#7 [...]/maintenance/refreshImageMetadata.php(264): require_once(string)
#8 {main}
Kghbln (talkcontribs)

Oh, that's interesting. Good find. Are you also on REL1_33 for TimedMediaHandler? If yes, this is a bug which should be reported on Phabricator for TimedMediaHandler.

Huwmanbeing (talkcontribs)

Yep, my version of TimedMediaHandler is indeed the latest — REL1_33.

Looks like there's already a thread about it here and that other users have experienced something similar. It sounds like those (like me) who download the TimedMediaHandler extension as a file via the ExtensionDistributor will miss out on certain necessary dependencies, and that instead one must install it through composer. I'm afraid I'm not familiar with Phabricator, but if the problem hasn't already been raised there then it seems like it should be.

Thank you again for your help!

Reply to "Thumbnails not appearing"